GLGETACTIVEUNIFORMBL(3G)

πŸ’… GLGETACTIVEUNIFORMBL(3G) β€” the manual page, bestie edition

Okay so real talk, this is from the [FIXME: manual] β€” the OpenGL manual β€” and it's about getting the name of one specific active uniform block. That's it. That's the whole vibe. Let's go πŸŽ€


✨ NAME ✨

glGetActiveUniformBlockName β€” retrieves the name of an active uniform block. literally just a name-fetching era πŸ’–


🌸 C SPECIFICATION 🌸

void glGetActiveUniformBlockName(GLuint program,
                                 GLuint uniformBlockIndex,
                                 GLsizei bufSize, GLsizei *length,
                                 GLchar *uniformBlockName);

Look at her. Five parameters. Iconic. πŸ‘‘


πŸ¦‹ PARAMETERS πŸ¦‹

  • program β€” this is the name of a program containing the uniform block. like, the program she lives in. 🏠
  • uniformBlockIndex β€” the index of the uniform block within program. which block? this one.
  • bufSize β€” the size of the buffer that uniformBlockName points at. how much room you're giving her.
  • length β€” the address of a variable that receives the number of characters written to uniformBlockName. she'll tell you how many she actually wrote πŸ₯°
  • uniformBlockName β€” the address of an array of characters that receives the name of the uniform block at uniformBlockIndex. this is where the name lands, bestie.

πŸ’œ DESCRIPTION πŸ’œ

So glGetActiveUniformBlockName retrieves the name of the active uniform block at uniformBlockIndex within program. Simple. Clean. Slay.

program must be the name of a program object for which glLinkProgram() must have been called in the past β€” but (and this is the key part!) it is not required that glLinkProgram() must have succeeded. The link could have failed because the number of active uniforms exceeded the limit. So like, a failed link is still a valid vibe here. no cap.

uniformBlockIndex is an active uniform block index of program, and must be less than the value of GL_ACTIVE_UNIFORM_BLOCKS. less than!! don't push her.

Upon success, the name of the uniform block identified by unifomBlockIndex is returned into uniformBlockName (btw that typo is their typo, I'm just the messenger πŸ™ˆ). The name is nul-terminated. The actual number of characters written into uniformBlockName, excluding the nul terminator, is returned in length. If length is NULL, no length is returned β€” she just keeps it to herself then πŸ’…

bufSize contains the maximum number of characters (including the nul terminator) that will be written into uniformBlockName. Budget accordingly 🫢

If an error occurs, nothing will be written to uniformBlockName or length. Nothing. Nada. She's not giving you anything on a bad day. 😭

πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_OPERATION is generated if program is not the name of a program object for which glLinkProgram() has been called in the past. πŸ‘€ did you even link her?
  • GL_INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of GL_ACTIVE_UNIFORM_BLOCKS, or is not the index of an active uniform block in program. out of bounds behavior is not the move β›”

⭐ NOTES ⭐

glGetActiveUniformBlockName is available only if the GL version is 3.1 or greater. that's the vibe check, and 3.0 did not pass it πŸ’€


🌈 VERSION SUPPORT 🌈

Here's the whole "is she invited to the party" breakdown β€” the function is glGetActiveUniformBlockName, and across the OpenGL versions:

  • 2.0 β€” - nope πŸ™…
  • 2.1 β€” - still nope πŸ™…
  • 3.0 β€” - so close and yet πŸ™…
  • 3.1 β€” βœ” YES bestie πŸŽ‰
  • 3.2 β€” βœ”
  • 3.3 β€” βœ”
  • 4.0 β€” βœ”
  • 4.1 β€” βœ”
  • 4.2 β€” βœ”
  • 4.3 β€” βœ”
  • 4.4 β€” βœ”
  • 4.5 β€” βœ”

She showed up in 3.1 and has been main character energy ever since πŸ‘‘βœ¨


🧚 SEE ALSO 🧚

  • glGetActiveUniformBlock()
  • glGetUniformBlockIndex()

go read those too, iykyk 🫢


Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

Copyright Β© 2010-2014 Khronos Group


okay that's the whole page, no notes πŸ“ and btw this was pulled from [FIXME: source], dated 08/09/2021, filed under GLGETACTIVEUNIFORMBL(3G) β€” go forth and get those uniform block names, bestie πŸ’…βœ¨

πŸ“¦ where this page comes from