glNewList, glEndList

[New - Windows 95, OEM Service Release 2]

The glNewList and glEndList functions create or replace a display list.

void glNewList(

    GLuint list,

 

    GLenum mode

 

   );

 

 

void glEndList(

    void

 

   );

 

 

Parameters

list

The display list name.

mode

The compilation mode. The following values are accepted:

GL_COMPILE

Commands are merely compiled.

GL_COMPILE_AND_EXECUTE

Commands are executed as they are compiled into the display list.

 

Remarks

Display lists are groups of OpenGL 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.

The glNewList function has two parameters. The first parameter, list, is a positive integer that becomes the unique name for the display list. Names can be created and reserved with glGenListsD_W.TJ and tested for uniqueness with glIsList1_9Z_94. The second parameter, mode, is a symbolic constant that can assume one of the two preceding values.

Certain commands are not compiled into the display list, but are executed immediately, regardless of the display list mode. These commands are glIsList1_9Z_94, glGenListsD_W.TJ, glDeleteListsKD976R, glFeedbackBuffer3L6J_WO, glSelectBuffer3YZO_H9, glRenderMode4MC301H, glReadPixels76DK080, glPixelStoreNHM7UO, glFlush2IEPF1, glFinishGQP_LC, glIsEnabled1MZ_ZK., and all of the glGet8KNKTW routines.

When the glNewList function 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.

The glCallList1PKP.MP and glCallLists4Z_.R05 functions 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.

The following function retrieves information related to glNewList:

glGet8KNKTW with argument GL_MATRIX_MODE

 

Error Codes

The following are the error codes generated and their conditions.

Error Code

Condition

GL_INVALID_VALUE

list was zero.

GL_INVALID_ENUM

mode was not an accepted value.

GL_INVALID_OPERATION

glEndList was called without a preceding glNewList, or if glNewList was called while a display list was being defined.

GL_INVALID_OPERATION

glNewList was called between a call to glBegin and the corresponding call to glEnd.

 

See Also

glBegin, glCallList, glCallLists, glDeleteLists, glEnd, glGenLists, glIsList