Problem displaying Vertex Buffer Object (OpenGL and Obj-C)

Posted by seaworthy on Stack Overflow See other posts from Stack Overflow or by seaworthy
Published on 2010-04-20T01:55:16Z Indexed on 2010/04/20 2:03 UTC
Read the original article Hit count: 338

Filed under:
|
|
|

Hey, I am having a problem displaying or loading a buffer with an array of vertices. I know that array works fine because I am able to render it using a loop and a glVertex command. I can't figure out what's wrong. Your insight is highly appreciated.

GLuint vboId;
 glGenBuffers( 1, &vboId );
 glBindBuffer( GL_ARRAY_BUFFER, vboId);
 glBufferData( GL_ARRAY_BUFFER, count*sizeof( GLfloat ),array,GL_STATIC_DRAW_ARB );
 glBindBuffer( GL_ARRAY_BUFFER, 0 );

 printf("%d\n",count);

 glEnableClientState( GL_VERTEX_ARRAY );
 glBindBuffer( GL_ARRAY_BUFFER, vboId );
 glVertexPointer( 3, GL_FLOAT, 0, 0 );
 glDisableClientState( GL_VERTEX_ARRAY );

 printf("vboId: [%hd]",vboId);
 glDeleteBuffers(1, &vboId);

Help?

© Stack Overflow or respective owner

Related posts about vbo

Related posts about vertex-buffer