SDL_DestroyWindow(3)

πŸ’– SDL_DestroyWindow β€” bestie edition πŸ’–

okay so this is SDL_DestroyWindow(3), a real one from the SDL3 FUNCTIONS manual, and we're gonna get into it. no cap, this page is short but it's giving important. ✨


πŸŽ€ NAME πŸŽ€

SDL_DestroyWindow β€” destroy a window. bye-bye, window. πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_video.h>

void SDL_DestroyWindow(SDL_Window *window);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. you call this and the window gets destroyed. that's the whole vibe. πŸ”₯

but wait β€” the plot twist: any child windows owned by the window will be recursively destroyed as well. yes, recursively. the whole family tree gets taken out together, it's giving generational. 🌸

and now the part you need to know, bestie: on some platforms, the visible window may not actually be removed from the screen until the SDL event loop is pumped again, even though the SDL_Window is no longer valid after this call. so the pixels might still be chilling on your screen for a sec while the actual object is already gone. don't touch that pointer afterward, fr fr. πŸ’€

πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • window β€” the window to destroy. that's it. that's the whole parameter. slay. πŸ‘‘

🧚 THREAD SAFETY 🧚

this function should only be called on the main thread. main character energy only, no side quests from other threads. periodt. 🚫


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on something older, sorry babe, it's not there. 🫢


⭐ SEE ALSO ⭐

like, if you're destroying windows you probably made some windows, so. iykyk. πŸŽ€


okay that's the whole page, you ate that. this little manual moment came to you from Simple Directmedia Layer, version SDL 3.4.18, dated SDL_DestroyWindow(3) β€” mwah, take care of your windows and your windows will take care of you. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from