Re: [PyOpenGL-Users] Rolling spectrogram with pyopengl
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2009-12-11 14:50:36
|
Ian Mallett wrote: > Some things definitely change, though--at least they do for me. > > Simply replacing "from OpenGL.GL import *" with "from OpenGL.raw.GL > <http://OpenGL.raw.GL> import *" gives problems. > > For example, glGenTextures(1) whines about needing two arguments. > Does it want a numpy array or something? Any of a numpy array, ctypes array, or ctypes byref( ctypes c_int ) for the single-int case. You'll find that pattern repeating all through your code-base, basically OpenGL seldom allocates memory, so anywhere something "returns" an array in PyOpenGL you will have to allocate the array yourself and pass it into the GL call for the raw APIs. All glGet* calls, for instance, will need to be altered. You'll also find that many array APIs will require the "full" form where you specify data-types, strides and the like (since you're using VBOs already, that shouldn't be a challenge for you). Upshot is, after you've done all that your code should work pretty-much unmodified with any raw OpenGL wrapper (SWIG, pyglet, Cython, etc). HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |