[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glNewList or glEndList Subroutine


Creates or replaces a display list.


OpenGL C bindings library: libGL.a

C Syntax

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.

Error Codes

GL_INVALID_VALUE List is 0 (zero).
GL_INVALID_ENUM Mode is not an accepted value.
GL_INVALID_OPERATION The glEndList subroutine is called without a preceding glNewList.


The glNewList subroutine is called while a display list is being defined.

GL_INVALID_OPERATION The glNewList subroutine is called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

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.

Related Information

The glBegin or glEnd subroutine, glCallList subroutine, glCallLists subroutine, glDeleteLists subroutine, glGenLists subroutine.

OpenGL Overview.

[ Previous | Next | Contents | Glossary | Home | Search ]