Creates or replaces a display list.
OpenGL C bindings library: libGL.a
void glNewList(GLuint List, GLenum Mode)
List | Specifies the display list name. |
Mode | Specifies the compilation mode, which can be GL_COMPILE or GL_COMPILE_AND_EXECUTE. |
Display lists are groups of GL commands that have been stored for subsequent execution. The display lists are created with the glNewList subroutine. All subsequent commands are placed in the display list, in the order issued, until the glEndList subroutine is called.
The glNewList subroutine 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 the glGenLists subroutine and tested for uniqueness with the glIsList subroutine. The second argument, Mode, is a symbolic constant that can assume one of two values:
GL_COMPILE | Commands are compiled only. |
GL_COMPILE_AND_EXECUTE | Commands are performed as they are compiled into the display list. |
The following subroutines are not compiled into the display list, but are performed immediately, regardless of the display-list mode:
When glEndList is encountered, the display-list definition is completed by associating the list with the unique name List (specified in glNewList). If a display list with the name List already exists, it is replaced only when glEndList is called.
The glCallList and glCallLists subroutines can be entered into display lists. The commands in the display list or lists run by glCallList or glCallLists are not included in the display list being created, even if the list creation mode is GL_COMPILE_AND_EXECUTE.
Associated gets for the glNewList and glEndList subroutines are as follows. (See the glGet subroutine for more information.)
/usr/include/GL/gl.h | Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. |
The glBegin or glEnd subroutine, glCallList subroutine, glCallLists subroutine, glDeleteLists subroutine, glGenLists subroutine.