GLDELETEBUFFERS(3G)

πŸ’… NAME πŸ’…

glDeleteBuffers β€” okay so this one deletes named buffer objects, periodt.

Oh also, hi, welcome to the 3G section of the manual (that's the OpenGL bit, iykyk) 🫢


✨ C SPECIFICATION ✨

void glDeleteBuffers(GLsizei n, const GLuint * buffers);

πŸŽ€ PARAMETERS πŸŽ€

  • n β€” literally just the number of buffer objects you wanna yeet. That's it, that's the number.
  • buffers β€” an array of buffer objects to be deleted. The squad of names getting the boot πŸ’€

🌸 DESCRIPTION 🌸

okay so glDeleteBuffers deletes n buffer objects, and it picks them out by the elements of the array buffers. Cute, efficient, no notes.

Once a buffer object is deleted, it has no contents, and its name is free for reuse β€” like, you can hand that name right back out, for example by glGenBuffers(). Recycling queen behavior β™»οΈπŸ‘‘

Now here's the spicy part: if a buffer object that is currently bound gets deleted, the binding reverts to 0 β€” which is the absence of any buffer object. So it doesn't dangle, it just goes to zero. No cap, that's genuinely reassuring.

Also, glDeleteBuffers silently ignores 0's and names that don't correspond to existing buffer objects. Silent. No error, no drama, no text back. It just moves on πŸ™ˆ


πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_VALUE is generated if n is negative. Like bestie, you can't delete a negative amount of things, be so fr 😭

πŸ¦‹ ASSOCIATED GETS πŸ¦‹

  • glIsBuffer()

πŸ‘‘ VERSION SUPPORT πŸ‘‘

Quick vibe check on where this lives β€” the original page drops a whole table, so here it is laid out in list form (the columns were Function / Feature Name on the left and then the OpenGL Version numbers across the top):

OpenGL Version β†’ supported?

  • 2.0 β†’ βœ”
  • 2.1 β†’ βœ”
  • 3.0 β†’ βœ”
  • 3.1 β†’ βœ”
  • 3.2 β†’ βœ”
  • 3.3 β†’ βœ”
  • 4.0 β†’ βœ”
  • 4.1 β†’ βœ”
  • 4.2 β†’ βœ”
  • 4.3 β†’ βœ”
  • 4.4 β†’ βœ”
  • 4.5 β†’ βœ”

And the function/feature name in that table is glDeleteBuffers, which is checking every single box. Ate. πŸ’…βœ¨


🌈 SEE ALSO 🌈

  • glBindBuffer()
  • glGenBuffers()
  • glGet()

Copyright Β© 2005 Addison-Wesley. 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/.

And the second copyright block, because they gave us two (iconic of them):

Copyright Β© 2005 Sams Publishing Copyright Β© 2010-2014 Khronos Group

okay that's the whole page, mwah πŸ“ so the fine print at the very bottom said the source was [FIXME: source] and the date was 08/09/2021 β€” so consider those noted, timestamped, and filed away for you bestie πŸ§šπŸ’–

πŸ“¦ where this page comes from