Thanks after a few try and error I was able to convert my code to use that class.

I have anyway a question regarding VBO usage in general.

What is the effect of not unbinding a VBO buffer after drawing and calling the drawing process again and again?

memory leak?

memory corruption?




Le 07/16/10 20:48, Ian Mallett a écrit :
That was a complete example of how to use the functions :-)

Here, I've added enough surrounding code to be self-explanatory. 

#Import it:
from OpenGL.arrays import vbo
import numpy as np
#Create a vertex buffer object
vertices = [  [0,0,0],[0,1,0],[1,0,0],  [2,0,0],[0,3,0],[4,9,6],  [7,8,1],...]
vertex_buffer_object = vbo.VBO(np.array(vertices,"f"),usage='GL_STATIC_DRAW')

#Draw VBO
glEnableClientState(GL_VERTEX_ARRAY); glVertexPointerf(vertex_buffer_object)


Normal, and texture VBOs work very similarly.  Vertex attribute VBOs require you to specify a shader, but you'll only need those for things like normal mapping, etc.

If you need more explanation, try:, or Google: "from OpenGL.arrays import vbo".  My implementation is here:, in glLib/ (class glLibObject) but it's probably too convoluted for a tutorial.