GLENABLEVERTEXATTRIB(3G)
okay so bestie, we're looking at the 3G manual page for glEnableVertexAttribArray and its whole little friend group β the functions that flip generic vertex attribute arrays on and off. It's giving "tiny page, huge consequences" energy. Let's go π
β¨ NAME β¨
glEnableVertexAttribArray, glDisableVertexAttribArray, glEnableVertexArrayAttrib, glDisableVertexArrayAttrib β literally just enable or disable a generic vertex attribute array. That's the whole gig. Turn it on, turn it off. Iconic. π
πΈ C SPECIFICATION πΈ
void glEnableVertexAttribArray(GLuint index);
void glDisableVertexAttribArray(GLuint index);
void glEnableVertexArrayAttrib(GLuint vaobj, GLuint index);
void glDisableVertexArrayAttrib(GLuint vaobj, GLuint index);
π¦ PARAMETERS π¦
vaobjβ the name of the vertex array object, but only forglDisableVertexArrayAttribandglEnableVertexArrayAttrib. The other two don't even wanna hear about it πindexβ which generic vertex attribute you're enabling or disabling. Just the index, bestie.
π DESCRIPTION π
glEnableVertexAttribArray and glEnableVertexArrayAttrib enable the generic vertex attribute array that index points at. The difference? glEnableVertexAttribArray uses the vertex array object that's currently bound for the operation, whereas glEnableVertexArrayAttrib goes and updates the state of the vertex array object with ID vaobj. Same energy, different target π―
glDisableVertexAttribArray and glDisableVertexArrayAttrib disable the generic vertex attribute array specified by index. And yeah, same split: glDisableVertexAttribArray uses the currently bound vertex array object for the operation, whereas glDisableVertexArrayAttrib updates the state of the vertex array object with ID vaobj.
By default, all client-side capabilities are disabled, and that includes every single generic vertex attribute array. All of them. Off. Asleep. π€
If it is enabled, tho? Then the values in the generic vertex attribute array get accessed and used for rendering whenever calls are made to vertex array commands like glDrawArrays(), glDrawElements(), glDrawRangeElements(), glMultiDrawElements(), or glMultiDrawArrays(). That's the whole point, periodt π
π₯ ERRORS π₯
GL_INVALID_OPERATIONis generated byglEnableVertexAttribArrayandglDisableVertexAttribArrayif no vertex array object is bound. Yes, you need one. No, you can't skip it. πGL_INVALID_OPERATIONis generated byglEnableVertexArrayAttribandglDisableVertexArrayAttribifvaobjis not the name of an existing vertex array object. Ghost VAO behavior is not it, bestie π»GL_INVALID_VALUEis generated ifindexis greater than or equal toGL_MAX_VERTEX_ATTRIBS. Respect the ceiling π«
π§ ASSOCIATED GETS π§
glGet()with argumentGL_MAX_VERTEX_ATTRIBSglGetVertexAttrib()with argumentsindexandGL_VERTEX_ATTRIB_ARRAY_ENABLEDglGetVertexAttribPointerv()with argumentsindexandGL_VERTEX_ATTRIB_ARRAY_POINTER
π VERSION SUPPORT π
So the original lays this out as a big grid of OpenGL versions β 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5 β with a β or a - for each function. Here's that same tea, function by function β
glDisableVertexArrayAttribβ-for2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3,4.4; β only in4.5. She's a late bloomer, we stan πglDisableVertexAttribArrayβ β in2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3,4.4,4.5. Everywhere. Always. Main character energy πglEnableVertexArrayAttribβ-for2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3,4.4; β in4.5. Twin behavior with her disable sister π«ΆglEnableVertexAttribArrayβ β in2.0,2.1,3.0,3.1,3.2,3.3,4.0,4.1,4.2,4.3,4.4,4.5. Certified everywhere legend β
π SEE ALSO π
glBindAttribLocation(), glDrawArrays(), glDrawElements(), glDrawRangeElements(), glMultiDrawElements(), glVertexAttrib(), glVertexAttribPointer() β go read these too, iykyk π
π 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 (yes, again) π
- Copyright Β© 2003-2005 3Dlabs Inc. Ltd.
- Copyright Β© 2010-2014 Khronos Group
And that's the page, bestie π«Ά the source line is literally [FIXME: source] (placeholder behavior, we love a mystery β¨) and it's dated 08/09/2021, all wrapped up as GLENABLEVERTEXATTRIB(3G). Go forth and enable some arrays π
π¦ 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