GLGETATTRIBLOCATION(3G)
π NAME π
okay so bestie, the manual name is GLGETATTRIBLOCATION(3G) β and this one is literally about returning the location of an attribute variable. periodt. β¨
β¨ C SPECIFICATION β¨
GLint glGetAttribLocation(GLuint program, const GLchar *name);
π PARAMETERS π
programβ specifies the program object to be queried, bestie.nameβ points to a null terminated string containing the name of the attribute variable whose location is to be queried.
π¦ DESCRIPTION π¦
glGetAttribLocation queries the previously linked program object specified by program for the attribute variable specified by name, and returns the index of the generic vertex attribute that is bound to that attribute variable. iconic behavior, honestly.
If name is a matrix attribute variable, the index of the first column of the matrix is returned. yes, first column. noted. π
If the named attribute variable is not an active attribute in the specified program object, or if name starts with the reserved prefix "gl_", a value of -1 is returned. that's the "nope, not found / not allowed" vibe. π
The association between an attribute variable name and a generic attribute index can be specified at any time by calling glBindAttribLocation(). but bestie, attribute bindings do not go into effect until glLinkProgram() is called. that's the whole plot twist.
After a program object has been linked successfully, the index values for attribute variables remain fixed until the next link command occurs. The attribute values can only be queried after a link if the link was successful. link first, then ask questions. π₯
glGetAttribLocation returns the binding that actually went into effect the last time glLinkProgram() was called for the specified program object. Attribute bindings that have been specified since the last link operation are not returned by glGetAttribLocation. no cap. π«Ά
π ERRORS π
GL_INVALID_OPERATIONβ is generated ifprogramis not a value generated by OpenGL.GL_INVALID_OPERATIONβ is generated ifprogramis not a program object.GL_INVALID_OPERATIONβ is generated ifprogramhas not been successfully linked.
π ASSOCIATED GETS π
glGetActiveAttrib()with argumentprogramand the index of an active attributeglIsProgram()
π VERSION SUPPORT π
The version-support table energy, minus the actual table because we're cute like that:
- 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β - Function / Feature Name β
glGetAttribLocationis supported in all of those, with every single box checkmarked β. she ate. π
πΈ SEE ALSO πΈ
glBindAttribLocation()glLinkProgram()glVertexAttrib()glVertexAttribPointer()
π COPYRIGHT π
Copyright Β© 2003-2005 3Dlabs Inc. Ltd. 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 Β© 2003-2005 3Dlabs Inc. Ltd. Copyright Β© 2010-2014 Khronos Group
cute little sign-off, bestie: source is [FIXME: source], dated 08/09/2021, and the manual name is GLGETATTRIBLOCATION(3G). mwah πβ¨
π¦ 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