Name
gl.NewList -- create or replace a display list
Synopsis
gl.NewList(list, mode)
Function
Display lists are groups of GL commands that have been stored for subsequent execution. Display lists are created with gl.NewList(). All subsequent commands are placed in the display list, in the order issued, until gl.EndList() is called.

gl.NewList() 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.GenLists() and tested for uniqueness with gl.IsList(). 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 that is currently active. These commands are gl.AreTexturesResident(), gl.ColorPointer(), gl.DeleteLists(), gl.DeleteTextures(), and gl.DisableClientState(), gl.EdgeFlagPointer(), gl.EnableClientState(), and gl.FeedbackBuffer(), gl.Finish(), gl.Flush(), gl.GenLists(), gl.GenTextures(), gl.IndexPointer(), gl.InterleavedArrays(), gl.IsEnabled(), and also gl.IsList(), gl.IsTexture(), gl.NormalPointer(), gl.PopClientAttrib(), and finally also gl.PixelStore(), gl.PushClientAttrib(), gl.ReadPixels(), gl.RenderMode(), gl.SelectBuffer(), gl.TexCoordPointer(), gl.VertexPointer(), and all of the gl.Get() commands.

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

gl.CallList() and gl.CallLists() can be entered into display lists. Commands in the display list or lists executed by gl.CallList() or gl.CallLists() are not included in the display list being created, even if the list creation mode is #GL_COMPILE_AND_EXECUTE.

A display list is just a group of commands and arguments, so errors generated by commands in a display list must be generated when the list is executed. If the list is created in #GL_COMPILE mode, errors are not generated until the list is executed.

Please consult an OpenGL reference manual for more information.

Inputs
list
specifies the display-list name as an integer
mode
specifies the compilation mode, which can be #GL_COMPILE or #GL_COMPILE_AND_EXECUTE
Errors
#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.EndList() is called without a preceding gl.NewList(), or if gl.NewList() is called while a display list is being defined.

#GL_INVALID_OPERATION is generated if gl.NewList() or gl.EndList() is executed between the execution of gl.Begin() and the corresponding execution of gl.End().

#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.)

Associated gets
gl.IsList()

gl.Get() with argument #GL_LIST_INDEX

gl.Get() with argument #GL_LIST_MODE


Show TOC