GLPUSHNAME(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

πŸŽ€ GLPUSHNAME πŸŽ€

okay bestie, we're in the 3G manual section and today's topic is glPushName and glPopName β€” the two functions that push stuff onto and pop stuff off the name stack. yes the name stack is real and yes it's a whole vibe. πŸ’…


✨ NAME ✨

glPushName, glPopName β€” push and pop the name stack 🫢


✨ C SPECIFICATION ✨

void glPushName( GLuint name )

🌸 PARAMETERS 🌸

  • name β€” the name you're yeeting onto the name stack. that's it, that's the whole parameter, she's simple and she serves. ✨

✨ C SPECIFICATION (round two, electric boogaloo) ✨

void glPopName( void )

πŸ’– DESCRIPTION πŸ’–

so, the name stack. it's the thing that shows up during selection mode and lets you give a unique identity to whole sets of rendering commands. it's an ordered set of unsigned integers, and it starts out empty β€” like, completely empty, no names, nothing, not a single one. πŸ™ˆ

glPushName causes name to be pushed onto the name stack. glPopName pops one name off the top of the stack. push, pop, push, pop, it's giving stack energy, it's giving LIFO, it's giving iconic. πŸ’…

the maximum name stack depth is implementation-dependent β€” no fixed number bestie, it depends on your implementation. call GL_MAX_NAME_STACK_DEPTH to find out the value for a particular implementation. and here's the part where we get serious for a sec:

it is an error to push a name onto a full stack, or to pop a name off an empty stack. it is also an error to manipulate the name stack between the execution of glBegin and the corresponding execution of glEnd. in any of these cases, the error flag is set and no other change is made to GL state. 🚨

also! the name stack is always empty while the render mode is not GL_SELECT. calls to glPushName or glPopName while the render mode is not GL_SELECT are ignored β€” literally just screaming into the void, no cap. πŸ’€


πŸ”₯ ERRORS πŸ”₯

  • GL_STACK_OVERFLOW is generated if glPushName is called while the name stack is full. (too much!! overflowing!! the drama!! 😭)
  • GL_STACK_UNDERFLOW is generated if glPopName is called while the name stack is empty. (popping from nothing?? she's empty bestie, stop 😭)
  • GL_INVALID_OPERATION is generated if glPushName or glPopName is executed between a call to glBegin and the corresponding call to glEnd. (do NOT do this in between, i am begging πŸ™ˆ)

πŸ‘‘ ASSOCIATED GETS πŸ‘‘

  • glGet with argument GL_NAME_STACK_DEPTH
  • glGet with argument GL_MAX_NAME_STACK_DEPTH

🌈 SEE ALSO 🌈

  • glInitNames(3G)
  • glLoadName(3G)
  • glRenderMode(3G)
  • glSelectBuffer(3G)

okay that's the whole page bestie, you ate that. this was GLPUSHNAME from the 3G manual β€” mwah, go push some names responsibly, and remember: no pushing on a full stack, no popping on an empty one. periodt. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from