Extracted from Pike v7.3 release 18 at 2002-03-27.
pike.roxen.com
[Top]
GL

Method GL.glEndList()


Method glEndList

void GL.glEndList()

Description

Display lists are groups of GL commands that have been stored for subsequent execution. Display lists are created with GL.glNewList. All subsequent commands are placed in the display list, in the order issued, until GL.glEndList is called.

GL.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 GL.glGenLists and tested for uniqueness with GL.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 glColorPointer, GL.glDeleteLists, GL.glDisableClientState, glEdgeFlagPointer, GL.glEnableClientState, glFeedbackBuffer, GL.glFinish, GL.glFlush, GL.glGenLists, glIndexPointer, glInterleavedArrays, GL.glIsEnabled, GL.glIsList, glNormalPointer, GL.glPopClientAttrib, glPixelStore, GL.glPushClientAttrib, glReadPixels, GL.glRenderMode, glSelectBuffer, glTexCoordPointer, glVertexPointer, and all of the glGet commands.

Similarly, GL.glTexImage2D and glTexImage1D are executed immediately and not compiled into the display list when their first argument is GL_PROXY_TEXTURE_2D or GL_PROXY_TEXTURE_1D, respectively.

When GL.glEndList is encountered, the display-list definition is completed by associating the list with the unique name list (specified in the GL.glNewList command). If a display list with name list already exists, it is replaced only when GL.glEndList is called.

Parameter list

Specifies the display-list name.

Parameter mode

Specifies the compilation mode, which can be GL_COMPILE or GL_COMPILE_AND_EXECUTE.

Throws

GL_INVALID_VALUE is generated if list is 0.

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if GL.glEndList is called without a preceding GL.glNewList, or if GL.glNewList is called while a display list is being defined.

GL_INVALID_OPERATION is generated if GL.glNewList or GL.glEndList is executed between the execution of GL.glBegin and the corresponding execution of GL.glEnd.

GL_OUT_OF_MEMORY is generated if there is insufficient memory to compile the display list. If the GL version is 1.1 or greater, no change is made to the previous contents of the display list, if any, and no other change is made to the GL state. (It is as if no attempt had been made to create the new display list.)