Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Maxfreilich

Display Lists?

This topic is 5404 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
*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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!