PDA

View Full Version : VBOs and reg vertex arrays



mdog1234
01-30-2004, 10:31 PM
Why do my VBOs work but my regular vertex arrays cause a crash. Here is the code:
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientStat(GL_TEXTURE_COORD_ARRAY );

if(VBOSupported)
{
glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBOVertices );
glVertexPointer( 3, GL_FLOAT, 0, (char *) NULL );
glBindBufferARB( GL_ARRAY_BUFFER_ARB, VBOTexels );
glTexCoordPointer( 2, GL_FLOAT, 0, (char *) NULL );

}
else
{
//This next line causes the crash. It needs to work for cards that dont support VBOs
glVertexPointer( 3, GL_FLOAT, 0,vertices );
glTexCoordPointer( 2, GL_FLOAT, 0, texels );
}

glDrawArrays( GL_TRIANGLES, 0, FacesToRender );
glDisableClientState( GL_TEXTURE_COORD_ARRAY );
glDisableClientState( GL_VERTEX_ARRAY );

Corrail
01-31-2004, 03:35 PM
Are you sure that there is NO buffer binded when passing regular arrays to the GL?