SDL_DestroyWindowSurface(3)

πŸ’– SDL_DestroyWindowSurface β€” the "bye bestie" button for your window's surface πŸ’–

okay so real talk, this is one of those little functions from SDL3 FUNCTIONS that does exactly one thing and does it flawlessly. It's giving cleanup era. It's giving "we're done here, close the tab." πŸŽ€

✨ NAME ✨

SDL_DestroyWindowSurface β€” literally just destroy the surface that's associated with the window. that's it. that's the whole job. no cap. πŸ’…

✨ SYNOPSIS ✨

#include <SDL3/SDL_video.h>

bool SDL_DestroyWindowSurface(SDL_Window *window);

she's short, she's sweet, she takes one pointer and returns a bool. iconic behavior honestly. 🌸

✨ FUNCTION PARAMETERS ✨

  • window β€” the window to update. (yes bestie, the parameter doc really does say "to update", we don't ask questions, we just pass the window. 😭)

✨ RETURN VALUE ✨

  • Returns true on success, or false on failure. 🫢
  • If it fails, pls pls pls call SDL_GetError() for more information β€” that's where the tea is. πŸ“

✨ THREAD SAFETY ✨

⚠️ bestie, listen. This function should only be called on the main thread. Not the side thread. Not your friend's thread. The main thread. periodt. πŸ‘‘

✨ AVAILABILITY ✨

This function is available since SDL 3.2.0. so if you're on something older, that's a you problem and you're gonna have to upgrade, sorry not sorry πŸ’€

✨ SEE ALSO ✨

the whole surface girlie friend group, we love a supportive squad 🌈


and that's the whole page!! brought to you by Simple Directmedia Layer, version SDL 3.4.18, in this absolutely gorgeous SDL_DestroyWindowSurface(3) moment. go forth and destroy that surface responsibly, bestie πŸ¦‹βœ¨πŸ’œ

πŸ“¦ where this page comes from