GLCALLLISTS(3G)

๐Ÿ“ฆ version 24.3.3, in opensuse-leap 16.0

๐Ÿ’– GLCALLLISTS(3G) ๐Ÿ’–

okay bestie, pull up a chair, because we're about to talk about glCallLists from the 3G manual section โ€” she's the OpenGL baddie who executes a whole list of display lists in one go and honestly? iconic. โœจ


๐ŸŒธ NAME ๐ŸŒธ

glCallLists โ€” execute a list of display lists. yes, a list of lists. we contain multitudes. ๐Ÿ’…


๐ŸŽ€ C SPECIFICATION ๐ŸŽ€

void glCallLists( GLsizei n,
                  GLenum type,
                  const GLvoid *lists )

๐Ÿฆ‹ PARAMETERS ๐Ÿฆ‹

  • n โ€” how many display lists you want executed. the headcount, the vibe check, the number of names we're pulling from lists.
  • type โ€” the type of the values chillin' inside lists. she accepts these 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. that's the whole roster. ๐Ÿซถ
  • lists โ€” the address of an array of name offsets in the display list. the pointer type is void because those offsets can be bytes, shorts, ints, or floats, depending on what type says. she's flexible like that, no cap. ๐ŸŒˆ

โœจ DESCRIPTION โœจ

so here's the tea: glCallLists makes every single display list named in the lists array actually run. and because of that, all the commands saved up in each display list get executed in order โ€” literally just as if you'd called them without using a display list at all. names of display lists that were never defined? ignored. we don't even look at them. ๐Ÿ’€

glCallLists is your efficient girlie for executing more than one display list at a time. and type is what lets her accept lists in all these different name formats:

  • GL_BYTE โ€” lists is treated as an array of signed bytes, each one in the range -128 through 127.
  • GL_UNSIGNED_BYTE โ€” lists is treated as an array of unsigned bytes, each one in the range 0 through 255.
  • GL_SHORT โ€” lists is treated as an array of signed two-byte integers, each one in the range -32768 through 32767.
  • GL_UNSIGNED_SHORT โ€” lists is treated as an array of unsigned two-byte integers, each one in the range 0 through 65535.
  • GL_INT โ€” lists is treated as an array of signed four-byte integers.
  • GL_UNSIGNED_INT โ€” lists is treated as an array of unsigned four-byte integers.
  • GL_FLOAT โ€” lists is treated as an array of four-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. math girlie behavior. ๐Ÿงฎ
  • 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 65536 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 16777216 times the unsigned value of the first byte, plus 65536 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.
okay so important: the list of display-list names is not null-terminated. no little \0 saying goodbye at the end, bestie. instead, n is what tells her exactly how many names to take from lists. periodt.

there's also an extra level of indirection available through the glListBase command โ€” she specifies an unsigned offset that gets added to each display-list name in lists before that display list is executed. cute little bonus layer. ๐ŸŽ

glCallLists can appear inside a display list, which is fun, but to avoid the possibility of infinite recursion from display lists calling each other, a limit is placed on the nesting level of display lists during display-list execution. this limit must be at least 64, and it depends on the implementation. so like, don't go feral with the recursion, she has boundaries. ๐Ÿšง

and heads up: GL state is not saved and restored across a call to glCallLists. so any changes made to GL state while those display lists are executing will still be there when execution finishes. if you want to preserve GL state across glCallLists calls, use glPushAttrib, glPopAttrib, glPushMatrix, and glPopMatrix. protect your state, queen. ๐Ÿ‘‘


๐Ÿ’œ 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. read the room and check the rules first, okay? ๐Ÿ™ˆ


๐Ÿ”ฅ ERRORS ๐Ÿ”ฅ

  • GL_INVALID_VALUE is generated if n is negative. bestie. how many lists. you cannot execute a negative number of lists. ๐Ÿ˜ญ
  • GL_INVALID_ENUM is generated if type is not one of GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_2_BYTES, GL_3_BYTES, GL_4_BYTES. pick from the menu or don't order. ๐Ÿ“

๐Ÿ‘‘ ASSOCIATED GETS ๐Ÿ‘‘

  • glGet with argument GL_LIST_BASE
  • glGet with argument GL_MAX_LIST_NESTING
  • glIsList

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

glCallList(3G), glDeleteLists(3G), glGenLists(3G), glListBase(3G), glNewList(3G), glPushAttrib(3G), glPushMatrix(3G)


and that's the whole page, bestie!! this was GLCALLLISTS(3G), living her best life in the 3G manual section โ€” go execute some display lists and slay ๐Ÿ’…โœจ๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from