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

glCallLists Subroutine

Purpose

Executes a list of display lists.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glCallLists(GLsizei Number,
      GLenum Type, 
      const GLvoid *Lists)

Parameters

Number Specifies the number of display lists to be executed.
Type Specifies the type of values in lists. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_2_BYTES, GL_3_BYTES, and GL_4_BYTES are accepted.
Lists Specifies the address of an array of name offsets in the display list. The pointer type is void because the offsets can be bytes, shorts, ints, or floats, depending on the value of Type.

Description

The glCallLists subroutine causes each display list in the list of names passed as lists to be executed. As a result, the commands saved in each display list are executed in order, just as if they were called without using a display list. Names of display lists that have not been defined are ignored.

The glCallLists subroutine provides an efficient means for executing display lists. The Number parameter allows lists with various name formats to be accepted. The formats are:

GL_BYTE Lists is treated as an array of signed bytes, each in the range -128 through 127.
GL_UNSIGNED_BYTE Lists is treated as an array of unsigned bytes, each in the range 0 through 255.
GL_SHORT Lists is treated as an array of signed 2-byte integers, each in the range -32,768 through 32,767.
GL_UNSIGNED_SHORT Lists is treated as an array of unsigned 2-byte integers, each in the range 0 through 65,535.
GL_INT Lists is treated as an array of signed 4-byte integers.
GL_UNSIGNED_INT Lists is treated as an array of unsigned 4-byte integers.
GL_FLOAT Lists is treated as an array of 4-byte floating-point values.
GL_2_BYTES Lists is treated as an array of unsigned bytes. Each pair of bytes specifies a single display list name. The value of the pair is computed as 256 times the unsigned value of the first byte plus the unsigned value of the second byte.
GL_3_BYTES Lists is treated as an array of unsigned bytes. Each triplet of bytes specifies a single display list name. The value of the triplet is computed as 65,536 times the unsigned value of the first byte, plus 256 times the unsigned value of the second byte, plus the unsigned value of the third byte.
GL_4_BYTES Lists is treated as an array of unsigned bytes. Each quadruplet of bytes specifies a single display list name. The value of the quadruplet is computed as 16,777,216 times the unsigned value of the first byte, plus 65,536 times the unsigned value of the second byte, plus 256 times the unsigned value of the third byte, plus the unsigned value of the fourth byte.

The list of display list names is not null-terminated. Rather, the Number parameter specifies how many names are to be taken from Lists.

An additional level of indirection is made available with the glListBase subroutine, which specifies a signed offset that is added to each display list name specified in Lists before that display list is executed.

The glCallLists subroutine can appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, an implementation-dependent limit is placed on the the nesting level of display lists during display list execution. This limit must be at least 64.

GL state is not saved and restored across a call to glCallLists. Thus, changes made to GL state during the execution of the display lists remain after execution is completed. Use the glPushAttrib, glPopAttrib, glPushMatrix, and glPopMatrix subroutines to preserve GL state across glCallLists calls.

Notes

Display lists can be executed between a call to glBegin and the corresponding call to glEnd, as long as the display list includes only commands that are allowed in this interval.

Associated Gets

Associated gets for the glCallLists subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_LIST_BASE

glGet with argument GL_MAX_LIST_NESTING

glIsList.

Files

/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, glDeleteLists subroutine, glGenLists subroutine, glListBase subroutine, glNewList subroutine, glPushAttrib or glPopAttrib subroutine, glPushMatrix or glPopMatrix subroutine.

OpenGL Overview.


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