GLGENVERTEXARRAYS(3G)

πŸ’… GLGENVERTEXARRAYS(3G) πŸ’…

okay bestie, welcome to the glGenVertexArrays page β€” it's part of the OpenGL 3G manual, and honestly? it's a little icon. let's get into it ✨


🌸 NAME 🌸

glGenVertexArrays β€” generate vertex array object names πŸŽ€


✨ C SPECIFICATION ✨

void glGenVertexArrays(GLsizei n, GLuint *arrays);

that's it. that's the whole signature. she's simple, she's effective πŸ’…


πŸ¦‹ PARAMETERS πŸ¦‹

  • n β€” how many vertex array object names you want to generate. yes, you get to pick the number. main character energy πŸ”₯
  • arrays β€” the array where the generated vertex array object names get stored. this is where the magic lands, bestie 🫢

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea: glGenVertexArrays hands you back n vertex array object names, and it drops them into arrays. πŸŽ€

now β€” important β€” there is no guarantee that the names it gives you form a contiguous set of integers. like, they're not gonna be 1, 2, 3, 4 all cute and in a row. nope. the vibes are chaotic. however (and this part is a promise), it is guaranteed that none of the returned names was in use immediately before the call to glGenVertexArrays. so no duplicates, no collisions, we love that for us ✨

also, the names you get back from a glGenVertexArrays call are not returned by subsequent calls β€” unless you first delete them with glDeleteVertexArrays(). so like, they're taken. claimed. spoken for. πŸ’€

and one more thing, because it's giving subtle-but-important: the names returned in arrays are marked as used for the purposes of glGenVertexArrays only. they don't actually have state or type yet β€” they only acquire state and type when they're first bound. so don't come for them before they've been bound, they're literally just names at this point πŸ™ˆ


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_VALUE gets generated if n is negative. so don't. negative n is not the vibe. just don't do it, bestie 😭

⭐ VERSION SUPPORT ⭐

so the original page has this whole grid situation going on, but the info is: here's which OpenGL versions support glGenVertexArrays. let me break it down for you by version πŸ‘‘

  • OpenGL 2.0 β€” nope, - (not supported) πŸ’€
  • OpenGL 2.1 β€” also nope, - (not supported) πŸ’€
  • OpenGL 3.0 β€” YES, βœ” πŸŽ‰
  • OpenGL 3.1 β€” βœ” πŸ”₯
  • OpenGL 3.2 β€” βœ” πŸ”₯
  • OpenGL 3.3 β€” βœ” πŸ”₯
  • OpenGL 4.0 β€” βœ” πŸ”₯
  • OpenGL 4.1 β€” βœ” πŸ”₯
  • OpenGL 4.2 β€” βœ” πŸ”₯
  • OpenGL 4.3 β€” βœ” πŸ”₯
  • OpenGL 4.4 β€” βœ” πŸ”₯
  • OpenGL 4.5 β€” βœ” πŸ”₯

so basically: she showed up in 3.0 and never left. ate and stayed. periodt 🫢


🌈 SEE ALSO 🌈

  • glBindVertexArray()
  • glDeleteVertexArrays()

go read those too, they're literally the other halves of this whole story iykyk 🧚


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


okay that's the whole page, bestie, you're officially educated on vertex array object name generation πŸ’œ ily, go bind something.

this little number came from [FIXME: source] and it's dated 08/09/2021 β€” yeah, the header up top is [FIXME: manual], she's a work in progress and we respect that πŸŽ€

πŸ“¦ where this page comes from