GLGETUNIFORMBLOCKIND(3G)
π GLGETUNIFORMBLOCKIND
okay bestie, so this is the 3G manual page for glGetUniformBlockIndex β dontcha worry, it's a lot less scary than the name sounds, I promise π«Ά
β¨ NAME β¨
glGetUniformBlockIndex β retrieve the index of a named uniform block
π C SPECIFICATION π
GLuint glGetUniformBlockIndex(GLuint program,
const GLchar *uniformBlockName);
πΈ PARAMETERS πΈ
programβ Specifies the name of a program containing the uniform block.uniformBlockNameβ Specifies the address an array of characters to containing the name of the uniform block whose index to retrieve. (yes, that's literally what it says, and yes, the grammar is giving "written at 3am" π but the meaning is: it's the address of a character array holding the name of the uniform block you want the index of π)
π¦ DESCRIPTION π¦
so glGetUniformBlockIndex retrieves the index of a uniform block within program. that's it, that's the whole vibe β¨
π important:programmust be the name of a program object for which the commandglLinkProgram()must have been called in the past β although it is not required thatglLinkProgram()must have succeeded. it could have failed because the number of active uniforms exceeded the limit. so like, past link attempt = valid, even a messy one, no cap.
uniformBlockName must contain a nul-terminated string specifying the name of the uniform block.
glGetUniformBlockIndex returns the uniform block index for the uniform block named uniformBlockName of program. If uniformBlockName does not identify an active uniform block of program, glGetUniformBlockIndex returns the special identifier, GL_INVALID_INDEX π© Indices of the active uniform blocks of a program are assigned in consecutive order, beginning with zero. (so the first one's 0, bestie, not 1 β don't come for me, that's just how it is π)
π₯ ERRORS π₯
GL_INVALID_OPERATIONis generated ifprogramis not the name of a program object for whichglLinkProgram()has been called in the past. π so if you never tried to link it, that's a you problem and the GL knows.
β NOTES β
glGetUniformBlockIndex is available only if the GL version is 3.1 or greater. lowkey gatekept by the version number π
π VERSION SUPPORT π
here's the function-by-feature-name table, laid out flat so we don't do tables (we're too good for tables) β the column headers are OpenGL Version 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, and the row is glGetUniformBlockIndex slash Feature Name:
- OpenGL Version
2.0β-(nope) - OpenGL Version
2.1β-(nope) - OpenGL Version
3.0β-(nope) - OpenGL Version
3.1ββyesss - OpenGL Version
3.2ββ - OpenGL Version
3.3ββ - OpenGL Version
4.0ββ - OpenGL Version
4.1ββ - OpenGL Version
4.2ββ - OpenGL Version
4.3ββ - OpenGL Version
4.4ββ - OpenGL Version
4.5ββ
it's giving "3.1 onwards, we ate" π
π SEE ALSO π
glGetActiveUniformBlockName()glGetActiveUniformBlock()glLinkProgram()
π 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
mwah, that's the whole page π it came from [FIXME: source] (yes, still an unfilled FIXME, iconic honestly π) and it's dated 08/09/2021, so if you're reading this in the future β hi, hope your uniforms are all bound correctly πβ¨π
π¦ 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