GLDELETESHADER(3G)

πŸ’– GLDELETESHADER ✨

So bestie, you found glDeleteShader β€” that's the OpenGL function from manual section 3G. The header up top is literally sitting there saying [FIXME: manual] and honestly? We stan a placeholder with main character energy. πŸ™ˆ Let's get into it.


🌸 NAME 🌸

glDeleteShader β€” deletes a shader object. That's the whole vibe. Poof, gone, see ya. πŸ’…


πŸŽ€ C SPECIFICATION πŸŽ€

Here's the signature, exactly as it is, no cap:

void glDeleteShader(GLuint shader);

πŸ¦‹ PARAMETERS πŸ¦‹

  • shader β€” specifies the shader object to be deleted. That's the one you're sending to the shadow realm, bestie. πŸ‘‘

✨ DESCRIPTION ✨

Okay so here's what actually happens. glDeleteShader frees the memory and invalidates the name associated with the shader object specified by shader. This command effectively undoes the effects of a call to glCreateShader(). It's giving rewind time, literally. 😭 Like you made a whole shader and now we're un-making it, periodt.

⚠️ But wait β€” plot twist! If a shader object to be deleted is attached to a program object, it will be flagged for deletion, but it will not be deleted until it is no longer attached to any program object, for any rendering context. That means it must be detached from wherever it was attached before it will be deleted. So it's not deleted-deleted yet, it's just on the list. Everyone say thank you to reference counting. 🫢

Also, a value of 0 for shader will be silently ignored. No error, no drama, no nothing. Just vibes. 🧚

To determine whether an object has been flagged for deletion, call glGetShader() with arguments shader and GL_DELETE_STATUS. That's your little vibe check on the situation. ⭐


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL. Basically if you hand it a random number that OpenGL did not birth, it will be very upset. 🚨

🌈 ASSOCIATED GETS 🌈

These are the functions that go with it, the friend group, the entourage:

  • glGetAttachedShaders() with the program object to be queried
  • glGetShader() with arguments shader and GL_DELETE_STATUS
  • glIsShader()

πŸ‘‘ VERSION SUPPORT πŸ‘‘

The original page has a big table of OpenGL versions, and the answer is yes to all of them, bestie. Every single one. πŸ’š The function name is glDeleteShader, and here's the run-down:

  • OpenGL 2.0 β€” βœ”
  • OpenGL 2.1 β€” βœ”
  • OpenGL 3.0 β€” βœ”
  • 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 β€” βœ”

Twelve for twelve. Ate. πŸ”₯


πŸ“ SEE ALSO πŸ“

Go read these too, they're part of the lore:

  • glCreateProgram()
  • glCreateShader()
  • glDetachShader()
  • glUseProgram()

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/

And again, because the page really said it twice (we love a repeat queen πŸ’…):

Copyright Β© 2003-2005 3Dlabs Inc. Ltd. Copyright Β© 2010-2014 Khronos Group


That's the whole page, bestie! πŸ¦‹βœ¨ This came from the source line that's literally just [FIXME: source] (another icon, another placeholder) and it's dated 08/09/2021 β€” shoutout to whoever generated this, we appreciate you fr fr. πŸŽ€πŸ’–

πŸ“¦ where this page comes from