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 withinprogram. which block? this one.bufSizeβ the size of the buffer thatuniformBlockNamepoints at. how much room you're giving her.lengthβ the address of a variable that receives the number of characters written touniformBlockName. 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 atuniformBlockIndex. 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 touniformBlockNameorlength. Nothing. Nada. She's not giving you anything on a bad day. π
π₯ ERRORS π₯
GL_INVALID_OPERATIONis generated ifprogramis not the name of a program object for whichglLinkProgram()has been called in the past. π did you even link her?GL_INVALID_VALUEis generated ifuniformBlockIndexis greater than or equal to the value ofGL_ACTIVE_UNIFORM_BLOCKS, or is not the index of an active uniform block inprogram. 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 π
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
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms