GLGETVERTEXARRAYIV(3G)

✨ GLGETVERTEXARRAYIV ✨

okay so this is the GLGETVERTEXARRAYIV(3G) page β€” yeah, the 3G is the manual it lives in, OpenGL vibes only. sit down bestie, we're learning how to peek inside a vertex array object πŸŽ€


🌸 NAME 🌸

glGetVertexArrayiv β€” retrieve parameters of a vertex array object. that's it, that's the whole job. she queries, she returns, she slays πŸ’…


πŸ¦‹ C SPECIFICATION πŸ¦‹

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

like, three arguments, no drama. iconic behavior honestly.


πŸ“ PARAMETERS πŸ“

  • vaobj β€” the name of the vertex array object to use for the query. this is the one you're snooping on πŸ‘€
  • pname β€” name of the property to use for the query. and listen: it must be GL_ELEMENT_ARRAY_BUFFER_BINDING. no substitutions, no "but what if Iβ€”", literally just that one. periodt.
  • param β€” returns the requested value. this is where the answer lands, so don't hand her a bad pointer bestie 😭

πŸ’– DESCRIPTION πŸ’–

so this function is your little backstage pass β€” it provides a mean of querying properties of an existing vertex array object. and the best part? the vertex array object does not have to be bound to the rendering context at the time of the call. she's off duty and you can still ask her questions. but β€” and this is the catch β€” it must have been bound at least once prior to this call. so like, she has to have been on stage at least one time in her life. no random strangers, iykyk 🌈

glGetVertexArrayiv can be used to retrieve the ID of a buffer object that will be bound to the GL_ELEMENT_ARRAY_BUFFER binding point whenever the queried vertex array object is bound to the rendering context. lowkey so useful β€” you get to know who's showing up to the party before the party even starts 🫢

and ngl, the binding can be changed for an active vertex array object with a glBindBuffer call. so it's not locked in forever, she can switch up her whole aesthetic πŸ’«


πŸ’€ ERRORS πŸ’€

these are the "girl, what are you doing" moments. know them, fear them, avoid them:

  • GL_INVALID_OPERATION error is generated if vaobj is not the name of an existing vertex array object. you made her up. she's not real. you can't query a ghost fr fr πŸ™ˆ
  • GL_INVALID_ENUM error is generated if pname is not GL_ELEMENT_ARRAY_BUFFER_BINDING. respectfully, that was not an option πŸ’€

πŸ‘‘ VERSION SUPPORT πŸ‘‘

okay so here's the vibe check across every OpenGL version, and the answer is kind of brutal but also iconic β€” she's a 4.5 girlie only. exclusive. main character energy:

  • OpenGL 2.0 β€” - nah
  • OpenGL 2.1 β€” - nah
  • OpenGL 3.0 β€” - nah
  • OpenGL 3.1 β€” - nah
  • OpenGL 3.2 β€” - nah
  • OpenGL 3.3 β€” - nah
  • OpenGL 4.0 β€” - nah
  • OpenGL 4.1 β€” - nah
  • OpenGL 4.2 β€” - nah
  • OpenGL 4.3 β€” - nah
  • OpenGL 4.4 β€” - nah
  • OpenGL 4.5 β€” βœ” THERE SHE IS πŸŽ‰πŸ‘‘

so yeah. glGetVertexArrayiv / Feature Name: only 4.5 gets the checkmark. everyone else can see themselves out πŸšͺ


πŸ”₯ SEE ALSO πŸ”₯

go read these next, bestie, they're the whole friend group:

  • glBindBuffer()
  • glBindVertexArray()
  • glGet()

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


aaaand that's the page 🫢 source is [FIXME: source], dated 08/09/2021, and yes the whole thing is still filed under GLGETVERTEXARRAYIV(3G) β€” bye bestie, go query something cute πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from