Problem displaying Vertex Buffer Object (OpenGL and Obj-C)
- by seaworthy
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?