display list efficiency

Okay, so display lists allow you to “pre-package” a bunch of OpenGL commands, right? So I’m wondering, what happens to the other code? So lets take this pseudo code example:

Start display list
for (int i = 0; i < numberOfVerts; i++) {
glVertex(vertexList[i]);
}
End display list

Does OpenGL only keep track of the GL calls? Or is it almost like a function call? Does it “unroll” the loop? What happens? Do my questions make any sense?

Thanks,
Greg

OpenGL won’t even know that there’s a loop going on. It only saves in-list-ALLOWED opengl calls.

Funny question - but …

> Does OpenGL only keep track of the GL calls?
Yes (do You see other possibilities?).
> Or is it almost like a function call?
(Mh? What you mean?) No.
> Does it “unroll” the loop?
Yes - it tracks only for glCalls and Your loop gives them.
> What happens?
Start display list - will set a flag to collect following OGL calls
glVertex3iv(ptr); - to display list goes a flag that identifies
following (glVertex) object and 3 floats for X,Y,Z.
End display list - back to immediate mode.
> Do my questions make any sense?
For You …

[CS]

Uups!

There was a god answer already.

Never mind…