Hey all,
The question isn't so much how to do it, I've figured that out, it's how you unbind a VBO and why having a bound VBO seems to block the usage of Vertex Arrays?
I have the following code in my rendering function:
if (VBO_Support)
{
glVertexPointer( 3, GL_FLOAT, sizeof(MyVertex), (GLvoid*) (*RenderListIT)->RenderMesh->VBO_Offset );
glNormalPointer( GL_FLOAT, sizeof(MyVertex), (GLvoid*)((*RenderListIT)->RenderMesh->VBO_Offset+sizeof(float)*3) );
glTexCoordPointer( 2, GL_FLOAT, sizeof(MyVertex), (GLvoid*)((*RenderListIT)->RenderMesh->VBO_Offset+sizeof(float)*6) );
glColorPointer( 3, GL_FLOAT, sizeof(MyVertex), (GLvoid*)((*RenderListIT)->RenderMesh->VBO_Offset+sizeof(float)*8) );
}
else
{
glVertexPointer( 3, GL_FLOAT, sizeof(MyVertex), &(*RenderListIT)->RenderMesh->VertexData->x );
glNormalPointer( GL_FLOAT, sizeof(MyVertex), &(*RenderListIT)->RenderMesh->VertexData->nx );
glTexCoordPointer( 2, GL_FLOAT, sizeof(MyVertex), &(*RenderListIT)->RenderMesh->VertexData->u );
glColorPointer( 3, GL_FLOAT, sizeof(MyVertex), &(*RenderListIT)->RenderMesh->VertexData->a );
}
And I have a toggle that changes VBO_Support back and forth. When I have a VBO bound (glBindBufferARB()) and VBO_Support = true everything runs fine but none of my objects display. Why is that?
Thanks in advance.