I read in a few places that glVertexPointer, glNormalPointer, and glTexCoordPointer are deprecated and we are supposed to use glVertexAttribPointer instead.
glBindBuffer(GL_ARRAY_BUFFER, positionVBO); glVertexPointer(VERTEX_STRIDE, GL_FLOAT, 0, 0); glEnableClientState(GL_VERTEX_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, positionVBO); glEnableVertexAttribArray(0); glVertexAttribPointer(0, VERTEX_STRIDE, GL_FLOAT, GL_FALSE, 0, 0);
So the position is associated with the attribute index 0.
Thats all well and good, but how would OpenGL know that the position is at attribute index 0 without a shader enabled? Is it really bad practice to use glVertexPointer, glNormalPointer, and glTexCoordPointer? Is it okay to mix these two styles?
Edited by mv348, 17 August 2012 - 12:57 PM.