GLPUSHCLIENTATTRIB(3G)
π
GLPUSHCLIENTATTRIB(3G) β the glPushClientAttrib(3G) page, bestie edition
okay so bestie, sit down, hydrate, and let me tell you about the two little functions that save your client state like it's a screenshot before you do something unhinged π
β¨ NAME β¨
glPushClientAttrib, glPopClientAttrib β push and pop the client attribute stack π
π«Ά C SPECIFICATION π«Ά
void glPushClientAttrib( GLbitfield mask); 1.1 )
πΈ PARAMETERS πΈ
1.1β Specifies a mask that indicates which attributes to save. Values for1.1are listed below. π
π¦ C SPECIFICATION π¦
void glPopClientAttrib( void); 1.1 )
π DESCRIPTION π
So glPushClientAttrib takes exactly one argument: a mask that says which groups of client-state variables you want saved onto the client attribute stack. You set the bits in that mask with symbolic constants, and 1.1 is typically built by OR'ing several of those constants together. And if you're feeling maximalist? The special mask GL_CLIENT_ALL_ATTRIB_BITS saves all stackable client state. no cap, all of it β¨
Here are the symbolic mask constants and their associated GL client state β second column is the actual tea, aka which attributes get saved:
GL_CLIENT_PIXEL_STORE_BITβ Pixel storage modesGL_CLIENT_VERTEX_ARRAY_BITβ Vertex arrays (and enables)
Meanwhile glPopClientAttrib restores the values of the client-state variables that were saved with the last glPushClientAttrib. Anything that wasn't saved? Left completely unchanged, minding its own business π
It is an error to push attributes onto a full client attribute stack, or to pop attributes off an empty stack. In either case the error flag gets set, and literally no other change is made to GL state. π
Initially, the client attribute stack is empty. A blank slate. main character energy π
π NOTES π
glPushClientAttribis available only if the GL version is1.1or greater.- Not all values for GL client state can be saved on the attribute stack. For example, select and feedback state cannot be saved. π
- The depth of the attribute stack depends on the implementation, but bestie, it must be at least
16. that's the floor, not the vibe. - Use
glPushAttribandglPopAttribto push and restore state that's kept on the server. Only pixel storage modes and vertex array state may be pushed and popped withglPushClientAttribandglPopClientAttrib. two different stacks, two different jobs π - When the
GL_ARB_multitextureextension is supported, pushing and popping client vertex array state applies to all supported texture units, and the active client texture state. β
π ERRORS π
GL_STACK_OVERFLOWis generated ifglPushClientAttribis called while the attribute stack is full.GL_STACK_UNDERFLOWis generated ifglPopClientAttribis called while the attribute stack is empty.
π₯ ASSOCIATED GETS π₯
glGetwith argumentGL_ATTRIB_STACK_DEPTHglGetwith argumentGL_MAX_CLIENT_ATTRIB_STACK_DEPTH
π SEE ALSO π
glColorPointer(3G), glDisableClientState(3G), glEdgeFlagPointer(3G), glEnableClientState(3G), glGet(3G), glGetError(3G), glIndexPointer(3G), glNormalPointer(3G), glNewList(3G), glPixelStore(3G), glPushAttrib(3G), glTexCoordPointer(3G), glVertexPointer(3G)
and that's the whole page, bestie π«Ά it lives in the 3G section and it's filed under GLPUSHCLIENTATTRIB(3G) β go push and pop responsibly, ily, 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