SDL_GL_DestroyContext(3)

πŸ’… SDL_GL_DestroyContext β€” from the SDL3 FUNCTIONS era πŸ’…

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we handle OpenGL contexts and we handle them correctly. today's main character is SDL_GL_DestroyContext, and yes she does exactly what it says on the tin.


✨ NAME ✨

SDL_GL_DestroyContext β€” delete an OpenGL context. that's it. that's the whole job. she's a closer, not a builder. πŸ’€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_video.h>

bool SDL_GL_DestroyContext(SDL_GLContext context);

look at her. one argument. no drama. no cap. 🌸


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • context β€” the OpenGL context that is going bye-bye. the one getting deleted. hand her over and let her go, bestie. 🫢

πŸ’– RETURN VALUE πŸ’–

returns true on success or false on failure. and if it fails? do not just sit there wondering, girl β€” call SDL_GetError() for more information. she'll tell you what went wrong, fr fr. 😭


🧚 THREAD SAFETY 🧚

⚠️ this function should only be called on the main thread.

read that again. main thread only. no side-quest threads, no sneaky background thread energy. main character only, periodt. πŸ‘‘


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. if you're on something older, she's not there yet, and no amount of manifesting will summon her. ✨


⭐ SEE ALSO ⭐


and that's the whole page, bestie. go forth, destroy your contexts responsibly, and remember: you created her, so you close her. πŸ’…

Simple Directmedia Layer Β· SDL 3.4.18 β€” mwah, love u, see u in the next man page πŸŽ€πŸ’œπŸ¦‹

πŸ“¦ where this page comes from