GLDELETEPROGRAM(3G)

✨ GLDELETEPROGRAM ✨

Okay so bestie, welcome to the GLDELETEPROGRAM(3G) glow-up πŸ’… β€” this is literally your cheat sheet for yeeting a program object into the void. No cap, it's easier than it sounds. Let's get into it 🫢


πŸŽ€ C SPECIFICATION πŸŽ€

The actual function signature, periodt:

void glDeleteProgram(GLuint program);

🌸 PARAMETERS 🌸

  • program β€” the program object you wanna delete. Like, which one are we removing, bestie? πŸ‘€

πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea β˜•: glDeleteProgram frees the memory and invalidates the name that's associated with the program object you passed in as program. It's giving undo. The way that this command effectively reverses all the effects of calling glCreateProgram()? Iconic 😭✨

Now, if a program object is in use as part of the current rendering state, it gets flagged for deletion β€” but it will not actually be deleted until it's no longer part of the current state for any rendering context. Main character energy: it doesn't leave the group chat until it's fully done πŸ«‘πŸ’€

Also, if a program object you're deleting has shader objects attached to it, those shader objects will be automatically detached (slay) but not deleted β€” unless they've already been flagged for deletion by a previous call to glDeleteShader(). So like, don't assume detached = gone, bestie πŸ™ˆ

And heads up: a value of 0 for program will be silently ignored. Not me, not the drama, just quietly no-op vibes πŸ’…

Wanna know if a program object has been flagged for deletion? Just call glGetProgram() with arguments program and GL_DELETE_STATUS. That's your vibe check ⭐


πŸ”₯ ERRORS πŸ”₯

Ngl, things can go wrong, so read this fam:
  • GL_INVALID_VALUE is generated if program is not a value generated by OpenGL. Fr fr, don't be making up numbers πŸ’€

🌈 ASSOCIATED GETS 🌈

These are the functions you can use to peek at the related state, iykyk:

  • glGet() with argument GL_CURRENT_PROGRAM πŸ¦‹
  • glGetProgram() with arguments program and GL_DELETE_STATUS πŸ‘‘
  • glIsProgram() 🌟

🧚 VERSION SUPPORT 🧚

The way this function is supported everywhere? Obsessed. Here's the run-down of which OpenGL versions have it β€” and bestie, it's all of them:

  • 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 β€” βœ”

Function / Feature Name: glDeleteProgram πŸ’…βœ¨


πŸ“ SEE ALSO πŸ“

Go check out these other icons when you're done here:

  • 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/.

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


And that's the whole page, bestie!! πŸŽ€ This gem came from [FIXME: manual] (literally the source is a FIXME, we love a mystery 😭), versioned 08/09/2021, and yeah β€” we are so done here. Bye babes πŸ’–πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from