PDA

View Full Version : Is this correct?



KRONOS
10-10-2000, 02:01 AM
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!

DrakanFyr
10-10-2000, 09:55 AM
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.

DFrey
10-10-2000, 10:44 AM
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.