glEndList
NAME
glNewList, glEndList -- create or replace a display list
C SPECIFICATION
void glNewList(GLuint list,
GLenum mode)
PARAMETERS
list
Specifies the display list name.
mode
Specifies the compilation mode, which can be GL_COMPILE or GL_COMPILE_AND_EXECUTE.
C SPECIFICATION
void glEndList(void void)
DESCRIPTION
Display lists are groups of GL commands that have been stored for subsequent execution. The display lists are created with glNewList. All subsequent commands are placed in the display list, in the order issued, until glEndList is called.
glNewList has two arguments. The first argument, list, is a positive integer that becomes the unique name for the display list. Names can be created and reserved with glGenLists and tested for uniqueness with glIsList. The second argument, mode, is a symbolic constant that can assume one of two values:
GL_COMPILE
Commands are merely compiled.
GL_COMPILE_AND_EXECUTE
Commands are executed as they are compiled into the display list.
Certain commands are not compiled into the display list, but are executed immediately, regardless of the display-list mode. These commands are glIsList, glGenLists, glDeleteList, glFeedbackBuffer, glSelectBuffer, glRenderMode, glReadPixels, glPixelStore, glFlush, glFinish, glIsEnabled, and all of the glGet routines.
When glEndList is encountered, the display-list definition is completed by associating the list with the unique name list (specified in the glNewList command). If a display list with name list already exists, it is replaced only when glEndList is called.
NOTES
glCallList and glCallLists can be entered into display lists. The commands in the display list or lists executed by glCallList or glCallLists are not included in the display list being created, even if the list creation mode is GL_COMPILE_AND_EXECUTE.
ERRORS
GL_INVALID_VALUE is generated if list is zero.
GL_INVALID_ENUM is generated if mode is not an accepted value.
GL_INVALID_OPERATION is generated if glEndList is called without a preceding glNewList, or if glNewList is called while a display list is being defined.
GL_INVALID_OPERATION is generated if glNewList is called between a call to glBegin and the corresponding call to glEnd.