GLNEWLIST(3G)
β¨ GLNEWLIST β¨
okay bestie, we're in the 3G corner of the manual (that's the OpenGL one, iykyk) and today's main characters are glNewList and glEndList β the duo that literally builds your display lists. slay.
π NAME π
glNewList, glEndList β create or replace a display list. that's it, that's the job. π
π C SPECIFICATION π
void glNewList( GLuint list,
GLenum mode )
πΈ PARAMETERS πΈ
listβ specifies the display-list name. yes, it's literally just the name, girl.modeβ specifies the compilation mode, which can beGL_COMPILEorGL_COMPILE_AND_EXECUTE.
π C SPECIFICATION (round two, the sequel) π
void glEndList( void )
no arguments. no drama. just vibes. π¦
π DESCRIPTION π
so picture this: display lists are groups of GL commands that have been stored for subsequent execution. they're created with glNewList. and then β this is the important part β all subsequent commands get placed into the display list, in the order issued, until glEndList is called. periodt. π
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 withglGenListsand tested for uniqueness withglIsList. no cap. - the second argument,
mode, is a symbolic constant that can assume one of two values:GL_COMPILEβ commands are merely compiled. they just sit there, being stored. iconic.GL_COMPILE_AND_EXECUTEβ commands are executed as they are compiled into the display list. multitasking queen behavior.
okay but here's the β¨ twist β¨. certain commands are not compiled into the display list at all β they're executed immediately, regardless of the display-list mode. the way that these just refuse to be contained... π
glAreTexturesResidentglColorPointerglDeleteListsglDeleteTexturesglDisableClientStateglEdgeFlagPointerglEnableClientStateglFeedbackBufferglFinishglFlushglGenListsglGenTexturesglIndexPointerglInterleavedArraysglIsEnabledglIsListglIsTextureglNormalPointerglPopClientAttribglPixelStoreglPushClientAttribglReadPixelsglRenderModeglSelectBufferglTexCoordPointerglVertexPointer
...and all of the glGet commands. all of them. every last one. π
similarly, glTexImage1D, glTexImage2D, and glTexImage3D 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.
(and yes bestie, the manpage really does say GL_PROXY_TEXTURE_1D twice there. i'm not fixing it, i'm not touching it, i'm just reporting the facts. π«Ά)
when the GL_ARB_imaging extension is supported, glHistogram executes immediately when its argument is GL_PROXY_HISTOGRAM. similarly, glColorTable executes immediately when its first argument is glPROXY_COLOR_TABLE, glPROXY_POST_CONVOLUTION_COLOR_TABLE, or glPROXY_POST_COLOR_MATRIX_COLOR_TABLE.
when the GL_ARB_multitexture extension is supported, glClientActiveTextureARB is not compiled into display lists, but executed immediately. it's giving independent. it's giving can't be tamed. π§
and then, when glEndList is encountered, the display-list definition is completed by associating the list with the unique name list (specified in the glNewList command). and listen β if a display list with name list already exists, it is replaced only when glEndList is called. not before. not mid-way. only at glEndList. the commitment!!! π
π NOTES π
glCallList and glCallLists can be entered into display lists. but here's the tea: commands in the display list or lists executed by glCallList or glCallLists are not included in the display list being created β even if the list creation mode is GL_COMPILE_AND_EXECUTE. they're doing their own thing, separately. main character energy only.
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. so like... the error is just β¨ pending β¨ until execution time. no cap.
π ERRORS π
GL_INVALID_VALUEis generated iflistis0. zero is not the moment, bestie.GL_INVALID_ENUMis generated ifmodeis not an accepted value.GL_INVALID_OPERATIONis generated ifglEndListis called without a precedingglNewList, or ifglNewListis called while a display list is being defined. you can't start a new list while you're still in the middle of one. one at a time, girl.GL_INVALID_OPERATIONis generated ifglNewListorglEndListis executed between the execution ofglBeginand the corresponding execution ofglEnd.GL_OUT_OF_MEMORYis generated if there is insufficient memory to compile the display list. and here's the important bit: 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.) literally like nothing happened. the audacity. π
π₯ ASSOCIATED GETS π₯
glIsListglGetwith argumentGL_LIST_INDEXglGetwith argumentGL_LIST_MODE
π¦ SEE ALSO π¦
glCallList(3G)glCallLists(3G)glDeleteLists(3G)glGenLists(3G)
okay that's the whole page bestie, you're officially a display list expert now, go forth and compile responsibly πβ¨π
this little love letter came straight out of the GLNEWLIST(3G) manual page, section 3G, and yeah β the header and the footer both just say GLNEWLIST(3G) back at you, so that's the version energy we're working with. mwah. π
πΈ
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- fedora 43: gl-manpages 1.1-34.20190306.fc43 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- fedora 44: gl-manpages 1.1-35.20190306.fc44 Β· Apache-2.0 AND HPND AND HPND-sell-variant AND MIT AND OpenPBS-2.3 AND SGI-B-2.0 AND W3C-19980720 AND X11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms