Re: [PyOpenGL-Users] Rolling spectrogram with pyopengl
Brought to you by:
mcfletch
From: René D. <re...@gm...> - 2009-12-11 14:54:55
|
2009/12/11 Ian Mallett <geo...@gm...>: > Some things definitely change, though--at least they do for me. > > Simply replacing "from OpenGL.GL import *" with "from OpenGL.raw.GL import > *" gives problems. > > For example, glGenTextures(1) whines about needing two arguments. Does it > want a numpy array or something? > > Ian > hi, yeah, the raw ones don't do all the nice pythony things for you. So using import * from the raw ones is probably not a good idea... but to instead use it only for the slow, or problematic functions. In this case glGenTextures is much like the C version. void glGenTextures(GLsizei n, GLuint * textures); So you need to pass it a pointer to some data where it will write your data. You can see the argument types like this: >>> OpenGL.raw.GL.glGenTextures._argtypes_ (<class 'ctypes.c_long'>, <class 'OpenGL.arrays.arraydatatype.GLuintArray'>) And give it the array to store a GLuint. >>> a = numpy.array([1], numpy.uint32) >>> OpenGL.raw.GL.glGenTextures(1, a) cu, |