GLGETUNIFORMINDICES(3G)
okay so bestie π you've stumbled into the OpenGL corner of the manual β this is GLGETUNIFORMINDICES from the 3G manual, and honestly? it's a little baddie of a function. let's get into it.
β¨ NAME β¨
glGetUniformIndices β retrieve the index of a named uniform block
π C SPECIFICATION π
like, here's the actual signature, don't come for me about the line breaks:
void glGetUniformIndices(GLuint program, GLsizei uniformCount,
const GLchar **uniformNames,
GLuint *uniformIndices);
π¦ PARAMETERS π¦
programβ the name of a program containing the uniforms whose indices you wanna query πuniformCountβ how many uniforms you're querying indices for, bestie. that's the count. that's the number.uniformNamesβ the address of an array of pointers to buffers that hold the names of the queried uniforms. yes, pointers to buffers. no, i'm not kidding πuniformIndicesβ the address of an array that's gonna receive the indices of the uniforms. it's giving output parameter energy β¨
π DESCRIPTION π
glGetUniformIndices retrieves the indices of a number of uniforms within program. simple as that, no cap.
program must be the name of a program object for which the command glLinkProgram() must have been called in the past β although it is not required that glLinkProgram() must have succeeded π. yeah. the link could have failed because the number of active uniforms exceeded the limit, and that's still valid here. iconic behaviour honestly.
uniformCount indicates both the number of elements in the array of names uniformNames and the number of indices that may be written to uniformIndices. one number, two jobs, main character energy π
uniformNames contains a list of uniformCount name strings identifying the uniform names to be queried for indices. for each name string in uniformNames, the index assigned to the active uniform of that name will be written to the corresponding element of uniformIndices. and if a string in uniformNames is not the name of an active uniform? the special value GL_INVALID_INDEX gets written to the corresponding element of uniformIndices instead π
the more you know.
if an error occurs, nothing is written to uniformIndices. like, at all. zero. nada. π«Ά
πΈ ERRORS πΈ
GL_INVALID_OPERATIONis generated ifprogramis not the name of a program object for whichglLinkProgram()has been called in the past. so like... callglLinkProgram()first, bestie. please.
β NOTES β
glGetUniformIndices is available only if the GL version is 3.1 or greater. sad for the old heads, slay for everyone else π
π VERSION SUPPORT π
here's the whole vibe check, verbatim, because i would never gatekeep:
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β OpenGL Version β
βββββββββββββββββββββββΌββββββ¬ββββββ¬ββββββ¬ββββββ¬ββββββ¬ββββββ¬ββββββ¬ββββββ¬ββββββ¬ββββββ¬ββββββ¬ββββββ€
β Function β 2.0 β 2.1 β 3.0 β 3.1 β 3.2 β 3.3 β 4.0 β 4.1 β 4.2 β 4.3 β 4.4 β 4.5 β
β / β β β β β β β β β β β β β
β Feature β β β β β β β β β β β β β
β Name β β β β β β β β β β β β β
βββββββββββββββββββββββΌββββββΌββββββΌββββββΌββββββΌββββββΌββββββΌββββββΌββββββΌββββββΌββββββΌββββββΌββββββ€
β glGetUniformIndices β - β - β - β β β β β β β β β β β β β β β β β β β
βββββββββββββββββββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ΄ββββββ
so basically: - for 2.0, 2.1 and 3.0, then a big fat β from 3.1 all the way through 4.5. ate and left no crumbs π
π₯ SEE ALSO π₯
glGetActiveUniform()glGetActiveUniformName()glLinkProgram()
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 π
Copyright Β© 2010-2014 Khronos Group
and that's the whole page, bestie π β massive love to <pink>[FIXME: source]</pink> for the source and to <purple>08/09/2021</purple> for the date, that's when this little queen was last touched up. now go call glLinkProgram() and slay π
β¨
π¦ 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