VBO question

Jason Hayes <[email protected]> Mon, 20 Jun 2011 12:20:27 -0700
Newsgroups gmane.comp.python.opengl.user,gmane.comp.python.opengl.devel
Message-ID <[email protected]>
Hello,

I am trying to get VBO's to work using OpenGL.GL.ARB.vertex_buffer_object and am running into issues getting this to work.  It basically renders nothing, and I have no clue why it wouldn't.

Here is the spirit of what I'm doing.

# in my mesh class
def  build(self):
#iterate over faces and build up an array of vertices with interleaved color info
vertices.append( [ x, y, z, r, g, b, a ] )

# convert vertices to numpy array

# send vertices over to the GPU
self.vbo_name = glGenBuffersARB( 1 )
glBindBufferARB( GL_ARRAY_BUFFER_ARB, self.vbo_name )
glBufferDataARB( GL_ARRAY_BUFFER_ARB, vertices, GL_STATIC_DRAW_ARB )


# in my main render loop

glEnableClientState( GL_VERTEX_ARRAY )
glEnableClientState( GL_COLOR_ARRAY )

glBindBufferARB( GL_ARRAY_BUFFER_ARB, mesh.vbo_name )
glVertexPointer( 3, GL_FLOAT, 28, 0 )
glColorPointer( 4, GL_FLOAT, 28, 16 )

glDrawArrays( GL_TRIANGLES, 0, mesh.num_raw_vertices )

glDisableClientState( GL_VERTEX_ARRAY )
glDisableClientState( GL_COLOR_ARRAY )


Any help as to what I could possibly be doing wrong here would be really appreciated.  Thanks!

-Jason



  ________________________________
This message, including any attachments, may contain privileged and/or confidential information. Any distribution or use of this email by anyone other than the intended recipient(s) is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and delete all copies. Thank you.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users