Is this correct?

This is how I use compiled vertex arrays:

void Redraw()
{
glVertexPointer(…);
glTexCoordPointer(…);
glLock(…);
glDrawElements(…,Index0);
glUnlock(…);

glVertexPointer(...);
glTexCoordPointer(...);
glLock(...);
glDrawElements(....,Index1);
glDrawElements(....,Index2);
glDrawElements(....,Index3);
glDrawElements(....,Index4);
glUnlock(...);

}

I can’t get any advantage from this, my frame rate doesn’t grow! Am I doing this proprely? I mean in every frame lock the same arrays?
Please help!

Check this discussion: http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/001105.html

I describe how I use Vertex Arrays and glDrawElements(). I don’t use glLock() and glUnlock() and it works fine. Can you combine any of the Index’s? The less of them you use the better.

You use glLock and glUnlock for compiled vertex arrays. And those are only beneficial when you want to draw the same exact vertex array multiple times, e.g. multipass rendering.