Documentation de Gambas - /comp/gb.opengl.glsl/gl/endlist

/comp/gb.opengl.glsl/gl/endlist

# Gl.EndList (gb.opengl)

Static Sub EndList ( )

Create or replace a display list.

### Parameters

list

  Specifies the display-list name.

mode

  Specifies the compilation mode, which can be Gl.COMPILE or Gl.COMPILE_AND_EXECUTE.

### Description

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. These commands are Gl.AreTexturesResident, Gl.ColorPointer, Gl.DeleteLists, Gl.DeleteTextures, Gl.DisableClientState, Gl.EdgeFlagPointer, Gl.EnableClientState, Gl.FeedbackBuffer, Gl.Finish, Gl.Flush, Gl.GenLists, Gl.GenTextures, Gl.IndexPointer, Gl.InterleavedArrays, Gl.IsEnabled, Gl.IsList, Gl.IsTexture, Gl.NormalPointer, Gl.PopClientAttrib, Gl.PixelStore, Gl.PushClientAttrib, Gl.ReadPixels, Gl.RenderMode, Gl.SelectBuffer, Gl.TexCoordPointer, Gl.VertexPointer, and all of the Gl.Get commands.

Similarly, Gl.TexImage1D, Gl.TexImage2D, and Gl.TexImage3D are executed immediately and not compiled into the display list when their first argument is Gl.PROXY_TEXTURE_1D, Gl.PROXY_TEXTURE_1D, or Gl.PROXY_TEXTURE_3D, respectively.

When the ARB_imaging extension is supported, Gl.Histogram executes immediately when its argument is Gl.PROXY_HISTOGRAM. Similarly, Gl.ColorTable executes immediately when its first argument is Gl.PROXY_COLOR_TABLE, Gl.PROXY_POST_CONVOLUTION_COLOR_TABLE, or Gl.PROXY_POST_COLOR_MATRIX_COLOR_TABLE.

For OpenGL versions 1.3 and greater, or when the ARB_multitexture extension is supported, Gl.ClientActiveTexture is not compiled into display lists, but executed immediately.

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.

### Notes

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.

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

### See also

- Gl.CallList,

- Gl.CallLists,

- Gl.DeleteLists,

- Gl.GenLists

See original documentation on OpenGL website