PDA

View Full Version : display list efficiency



gtada
12-08-2000, 01:45 PM
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

Michael Steinberg
12-09-2000, 07:08 AM
OpenGL won't even know that there's a loop going on. It only saves in-list-ALLOWED opengl calls.

CS
12-09-2000, 07:50 AM
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?
http://www.opengl.org/discussion_boards/ubb/smile.gif For You ...

[CS]

CS
12-09-2000, 07:51 AM
Uups!

There was a god answer already.

Michael Steinberg
12-09-2000, 07:57 AM
Never mind...