next up previous
Next: Transformations and Perspective: Up: OpenGL Quick Reference Guide Previous: GLUT Menu Functions:

Display lists

Because of its structure, OpenGL requires lots of procedure calls to render a complex object. To improve efficiency, OpenGL allows you to generate an object, called a display list, into which OpenGL commands are stored in an efficient internal format, which can be called back again in the future.

GLuint glGenLists(GLsizei range):
Allocates range new display lists. It returns a number n, where the new lists are numbered n, n+1, ..., n+range-1.
glNewList(GLuint list, GLenum mode)...glEndList(void):
All OpenGL commands between such a pair are stored in display list list. The mode is either GL_COMPILE, to compile the list, or GL_COMPILE_AND_EXECUTE to both compile and execute. Note that some OpenGL commands (mostly those having to do with accessing the current state) are executed immediately and not compiled. See the reference manual for details.
glCallList(GLuint list):
Invokes the given display list. (Note that the system does not make any effort to save its current state, thus the display list should make use of functions such as glPushMatrix() and glPopMatrix() to save and restore the current state.)

Please report any errors or send comments to Dave Mount

Last updated: Sat, Feb 8, 2003.