TerranFury
09-02-2001, 02:30 PM
How can the same geometry be rendered multiple times using compiled vertex arrays? For example, if I have the following code (tell me if it is incorrect and my drivers are just being forgiving):
glVertexPointer (3, GL_FLOAT, 0, verts);
glTexCoordPointer(2, GL_FLOAT, 0, texs);
glColorPointer(4, GL_FLOAT, 0, cols0);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glLockArraysEXT (0, view_x * 2);
for(unsigned int i = view_y - 2; i <= view_y - 2; i--)
{
glDrawElements (GL_TRIANGLE_STRIP, view_x * 2, GL_UNSIGNED_INT, &strips[i]);
}
glUnlockArraysEXT();
How then can I bind a new texture, change the color pointer, and redraw the same geometry without re-transforming it?
Perhaps I don't understand CVA's well enough. I understand vertex arrays; that isn't a terribly difficult concept. Bu there are a few things about the compiled flavor that I don't get:
- When are they compiled?
- How are they called?
Because the image I have in my mind is of an EXECUTE_AT_ONCE display list, and I have a feeling that's not the right one.
glVertexPointer (3, GL_FLOAT, 0, verts);
glTexCoordPointer(2, GL_FLOAT, 0, texs);
glColorPointer(4, GL_FLOAT, 0, cols0);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glLockArraysEXT (0, view_x * 2);
for(unsigned int i = view_y - 2; i <= view_y - 2; i--)
{
glDrawElements (GL_TRIANGLE_STRIP, view_x * 2, GL_UNSIGNED_INT, &strips[i]);
}
glUnlockArraysEXT();
How then can I bind a new texture, change the color pointer, and redraw the same geometry without re-transforming it?
Perhaps I don't understand CVA's well enough. I understand vertex arrays; that isn't a terribly difficult concept. Bu there are a few things about the compiled flavor that I don't get:
- When are they compiled?
- How are they called?
Because the image I have in my mind is of an EXECUTE_AT_ONCE display list, and I have a feeling that's not the right one.