CVAs

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.

personally compiled aint the best descriptioj for what they are. locked or transformed once would be better

the wway youre using them u prolly wont get any performance increase. try sonmething like this

glVertexPointer (3, GL_FLOAT, 0, verts);
glTexCoordPointer(2, GL_FLOAT, 0, texs);
glColorPointer(4, GL_FLOAT, 0, cols0);

glLockArraysEXT (0, view_x * 2);

loop (multiple passes )
{
glBindTexture(GL_TEXTURE_2D, texture[loop]);
glDrawElements (GL_TRIANGLE_STRIP, view_x * 2, GL_UNSIGNED_INT, &strips[i]);
} end loop

glUnlockArraysEXT();

btw i didnt check your syntax so it could be wrong also BTW
use GL_UNSIGNED_SHORT instead of unigned_int ( less data == better performance)

Less data doesn’t always mean better performance. Sometimes, memory alignment is a more important factor that affects processing speed.

true,true but in this case it does