Display Lists?

Started by
7 comments, last by Maxfreilich 20 years, 1 month ago
Hey all. I am in the process of learning OpenGL from the ground up. My question is this. Are display lists used commonly anymore? My reason for asking this is that some people have told me that they are uncommon and don''t use them, so I am wondering if I should even bother learning them at all. Thanks for the help.
Advertisement
I use them. They''re not that difficult to understand. If you consider glVertex, etc. as instructions in the "GL programming language", then display lists are macros.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” — Brian W. Kernighan (C programming language co-inventor)
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Yeah I have looked at them briefly and I noticed they''re not that hard to learn/use, I was just wondering if they are a thing of the past or are they still "widely" used today.
*shrug* What would replace them with? Vertex arrays don''t let you affect server state like transformation matrices.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” — Brian W. Kernighan (C programming language co-inventor)
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Alright well thanks for the advice. They actually seem pretty cool now that I look at them. Thanks a lot.
One useful thing to know is that, even though you can''t alter what a given display list does (without recompiling it), like which vertices it creates, which rotations, etc, you can modify the display lists that get called.

That is, even though you can''t alter the fact that display list 1 calls display list 2, you can change what display list 2 itself does - which will alter the behaviour of display list 1.

So they''re a bit more like parameterless functions than macros, actually.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I think Display lists are also very useful for state changes which span a large number of functions in OGL. By compiling the state changes into a display list, the driver can compile it to what it thinks is most efficient for the gfx card. Also, if you compiled 10 functions into a display list, you would save the overhead of 9 function calls which can add up to quite a bit if used often.

If im not mistaken, GFX API function calls tend to be expensive because it has to interact with the driver which in turn has to interact with the Gfx card. Which probably explains why immediate mode is so slow.
immediate mode is slow because of function overhead instead of batching things together.

State change functions are slow because changing state on the gpu is slow, however i''m guessing because the translation is already done when the display list is compiled removing the overhead of function calls and maybe being able to batch the state change commands together better results in a reasonable speed up, but the problem of state changes being slow still wont magicaly go away, you''ll just be helping the gpu a bit

Display lists can be really helpful if u have to do lengthy calculations to figure out the 3D object u wish to draw, and the calculations remain constant throughout.

I agree that they take a little more time initializing but then object movement is faster than doing all the calculations all over again.

A big problem is that they take up quite a lot of memory if the object requires a lot of coordinates to draw.
SuperDuck=========We are all like a duck ... it looks calm and cool above the water; but underneath, its tiny feet are peddling hard to stay afloat. Me? I''m just another duck in the pond!!!

This topic is closed to new replies.

Advertisement