Jump to content
  • Advertisement
Sign in to follow this  
Fred304

Display Lists

This topic is 4902 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

In my tetris game I generate a display list
GLuint dl = glGenLists(1);
and compile it
glNewList(dl, GL_COMPILE);
glBegin(GL_QUADS);
// ... some meaningful stuff
glEnd();
glEndList();
If I want my display list to change, can I just compile it again, or do I have to call glDeleteLists and glGenLists once more before compiling? I googled for half an hour, but I only find "static" examples of display lists.

Share this post


Link to post
Share on other sites
Advertisement
i've always just deleted it, then re-created it. Never had a big problem with that. If your data is constantly changing then you might want to look at vertex arrays or VBO's

Share this post


Link to post
Share on other sites
Display lists are designed for static data which is why you'll only find static examples. In an editor recompiling on the fly probably wont cause you problems however in a game situation the recompile can crash your framerate (as recompile time isnt constant) and it could interact strangely with other part of the game rendering.

If you want dynamic data, use a dynamic system.

Share this post


Link to post
Share on other sites
As said above, for quads or cubes in a tetris game, display lists work fine. Plus, if you don't set the color, rather just the verts in the list, you can change the color and or texture at run-time according to what block it is, without recompiling the list. If you need verts that change as well, try using vertex arrays instead. Most people say they provide about the same speed up overall, but vertex arrays can change at runtime, so they work diffently. NEVER re-compile a list at run-time, unless it is a slow app in which speed doesn't matter. Even as slow processing as Tetris is, don't do it. Just change the color and leave the color out when you compile the list, and the renderer will use the current color when you call the list.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!