Sign in to follow this  

Display Lists

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

This topic is 4596 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this