GLGETVERTEXARRAYINDE(3G)

πŸ’… glGetVertexArrayIndexed(3G) β€” the manual page bestie GLGETVERTEXARRAYINDE ✨

okay so bestie, listen up πŸ’– this is the whole entire manual page for glGetVertexArrayIndexed, and we're gonna get through it together, no cap. it's giving "OpenGL deep lore" but make it cute. let's go 🫢


✨ NAME ✨

glGetVertexArrayIndexed β€” retrieve parameters of an attribute of a vertex array object. literally what it says on the tin, bestie πŸŽ€


🌸 C SPECIFICATION 🌸

okay so here's the exact function signatures, copy them character for character or it's not gonna compile and you'll be sad 😭

void glGetVertexArrayIndexed64iv(GLuint vaobj, GLuint index,
                                 GLenum pname, GLint64 *param);

void glGetVertexArrayIndexediv(GLuint vaobj, GLuint index, GLenum pname,
                               GLint *param);

πŸ¦‹ PARAMETERS πŸ¦‹

  • vaobj β€” specifies the name of a vertex array object. like, which VAO are we talking about, bestie? πŸ‘‘
  • index β€” specifies the index of the vertex array object attribute. must be a number between 0 and (GL_MAX_VERTEX_ATTRIBS - 1). no exceptions, periodt πŸ’…
  • pname β€” specifies the property to be used for the query. for glGetVertexArrayIndexediv, it must be one of these values: GL_VERTEX_ATTRIB_ARRAY_ENABLED, GL_VERTEX_ATTRIB_ARRAY_SIZE, GL_VERTEX_ATTRIB_ARRAY_STRIDE, GL_VERTEX_ATTRIB_ARRAY_TYPE, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, GL_VERTEX_ATTRIB_ARRAY_INTEGER, GL_VERTEX_ATTRIB_ARRAY_LONG, GL_VERTEX_ATTRIB_ARRAY_DIVISOR, or GL_VERTEX_ATTRIB_RELATIVE_OFFSET. for glGetVertexArrayIndexed64v, it must be equal to GL_VERTEX_BINDING_OFFSET. iykyk 🌈
  • param β€” returns the requested value. it's the output, bestie, where the answer goes πŸ“

πŸ’œ DESCRIPTION πŸ’œ

okay so glGetVertexArrayIndexediv and glGetVertexArrayIndexed64iv provide a way of querying parameters of an attribute at an user-specified index of a vertex array object. and here's the iconic part: the vertex array object does not have to be bound to the rendering context at the time of the call, but it must have been bound at least once prior to this call. so like, it's not a main character right now but it had its moment πŸ’€

the following parameter values can be retrieved with glGetVertexArrayIndexediv for each of the attributes defined for a vertex array object:

  • GL_VERTEX_ATTRIB_ARRAY_ENABLED: param returns a value that is non-zero (true) if the vertex attribute array for index is enabled and 0 (false) if it is disabled. the initial value is GL_FALSE. so like, default is off, no cap πŸ™ˆ
  • GL_VERTEX_ATTRIB_ARRAY_SIZE: param returns a single value, the size of the vertex attribute array for index. the size is the number of values for each element of the vertex attribute array, and it will be 1, 2, 3 or 4. the initial value is 4. so default is 4, periodt πŸŽ€
  • GL_VERTEX_ATTRIB_ARRAY_STRIDE: param returns a single value, the array stride for (number of bytes between successive elements in) the vertex attribute array for index. a value of 0 indicates the array elements are stored sequentially in memory. the initial value is 0. so zero means packed tight, cute πŸ’–
  • GL_VERTEX_ATTRIB_ARRAY_TYPE: param returns a single value, a symbolic constant indicating the array type for the vertex attribute array for index. possible values are GL_BYTE, GL_DOUBLE, GL_FIXED, GL_FLOAT, GL_HALF_FLOAT, GL_INT, GL_INT_2_10_10_10_REV, GL_SHORT, GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, GL_UNSIGNED_INT_2_10_10_10_REV, and GL_UNSIGNED_INT_10F_11F_11F_REV. the initial value is GL_FLOAT. so many options, it's giving variety ✨
  • GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: param returns a single value that is non-zero (true) if fixed-point data types for the vertex attribute array indicated by index are normalized when they are converted to floating-point, and 0 (false) otherwise. the initial value is GL_FALSE. so default is not normalized, ngl 🧚
  • GL_VERTEX_ATTRIB_ARRAY_INTEGER: param returns a single value that is non-zero (true) if fixed-point data types for the vertex attribute array indicated by index have integer data type, and 0 (false) otherwise. the initial value is 0 (GL_FALSE). so default is not integer, fr fr 🌸
  • GL_VERTEX_ATTRIB_ARRAY_LONG: param returns a single value that is non-zero (true) if a vertex attribute is stored as an unconverted double, and 0 (false) otherwise. the initial value is 0 (GL_FALSE). so default is not long, bestie πŸ’…
  • GL_VERTEX_ATTRIB_ARRAY_DIVISOR: param returns a single value that is the frequency divisor used for instanced rendering. see glVertexAttribDivisor. the initial value is 0. so like, instancing stuff, you know how it is πŸ”₯
  • GL_VERTEX_ATTRIB_RELATIVE_OFFSET: param returns a single value that is the byte offset of the first element relative to the start of the vertex buffer binding specified attribute fetches from. the initial value is 0. so offset is zero by default, iconic πŸ‘‘

glGetVertexArrayIndexed64iv can be used to retrieve GL_VERTEX_BINDING_OFFSET parameter value for any of the attributes defined for a vertex array object. when pname is set to GL_VERTEX_BINDING_OFFSET, param returns a single value that is the byte offset of the first element in the bound buffer's data store. the initial value for this parameter is 0. so yeah, that's the 64-bit girlie's whole thing πŸ’–


😭 ERRORS 😭

okay so if you mess up, here's what you'll get:

  • GL_INVALID_OPERATION error is generated if vaobj is not the name of an existing vertex array object. so like, you made it up or it's gone πŸ’€
  • GL_INVALID_VALUE error is generated if index is greater than or equal to the value of GL_MAX_VERTEX_ATTRIBS. out of bounds, bestie, we don't do that 🚫
  • GL_INVALID_ENUM error is generated if pname is not one of the valid values. for more details, please see above. like, check the list, it's right there πŸ™ˆ

πŸ”₯ VERSION SUPPORT πŸ”₯

here's the vibe check on which OpenGL versions support these functions. spoiler: it's only 4.5, so if you're on anything older, sorry bestie 😭

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                             β”‚                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                        β”‚     β”‚     β”‚     β”‚     β”‚     β”‚     β”‚     β”‚     β”‚     β”‚     β”‚     β”‚     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
β”‚ glGetVertexArrayIndexed64iv β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  βœ”  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€
β”‚ glGetVertexArrayIndexediv   β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  -  β”‚  βœ”  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜

so both functions are only in 4.5. no cap, that's the whole table 🌈


⭐ SEE ALSO ⭐

if you liked this, you'll love these besties:

  • glGetVertexAttrib()
  • glVertexAttribBinding()
  • glVertexAttribIPointer
  • glVertexAttribLPointer
  • glVertexAttribPointer()

go read them, they're iconic too πŸ’…


Copyright Β© 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 Β© 2014 Khronos Group


okay bestie, that's the whole page. you ate that πŸ’– this was [FIXME: source] from 08/09/2021, so like, a little vintage but still slaying. now go forth and query those vertex array attributes, periodt 🫢✨

πŸ“¦ where this page comes from