Hi,
I recently started using VBOs for creating some cuboidal objects. The objects are coming out fine, but I am unable to define a texture for 'em.
The code is something like:
glBindTexture(GL_TEXTURE_2D, <some_index>);
/*
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
GLdouble texVertices[] = { 0,0, 1,0, 1,1, 0,1 };
glTexCoordPointer(2, GL_DOUBLE, 0 , texVertices);
*/
glBindBuffer(GL_ARRAY_BUFFER, <vbo_object>)
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_DOUBLE, 0, NULL);
glDrawArrays(GL_QUADS, j*4, 4); // j here is an iterator; values goes 0,4,8,12,16,20 for the 6 planes.
glEnable(GL_DEPTH_TEST);
As you can see, my texture vertices are defined separately and not part of the vbo. But if I try using the commented code, I get an access violation error.
What should I be fixing?