[PyOpenGL-Users] VBOs and gl*Pointer offset parameter
Brought to you by:
mcfletch
From: renaud b. <rnd...@gm...> - 2009-07-16 08:09:12
|
hello, i start to experiment with VBOs to prepare some code to the future of opengl :) i try to use a single array buffer to store a bunch of vertices and then the associated colors. as far as i understand, i should then use the last parameter of the usual gl[Vertex|Color]Pointer to pass the offset of the first element inside the array. for the vertices, it's 0, so i can pass None (the c functions expect a void* parameter). the problem is for non-zero offsets, e.g. for the colors in this case. it seems that the python wrapper interprets the last parameter as an array, and i have not found a way to pass an offset without "dewrapping" the function, i.e. offset = 12 glColorPointer.wrappedOperation(3, GL_FLOAT, 0, offset) # works glColorPointer(3, GL_FLOAT, 0, any_thing_i_could_think_of(offset)) # doesn't work i've tried several any_thing_i_could_think_of functions (casting to c_void_p, etc.) with no luck. any advice ? i've started looking into pyopengl code to see if the wrapper could be made more "clever" by distinguishing array-like and offset-like use of the last parameter but i need some time to fully understand the wrapping of the pointer functions. thanks for any advice, renaud |