SDL_UnregisterApp(3)

πŸ’… SDL_UnregisterApp πŸ’…

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, page SDL_UnregisterApp(3) β€” she's niche, she's win32-coded, and she's here to clean up after her sister. let's get into it πŸŽ€


✨ NAME ✨

SDL_UnregisterApp β€” deregister the win32 window class from an SDL_RegisterApp call. it's the un-registration. the goodbye. the "we don't do that here anymore" πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_main.h>

void SDL_UnregisterApp(void);

that's it. no args, no return value, no drama. she takes nothing and gives nothing back, which honestly? iconic πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

so like, you know how SDL_RegisterApp does a thing? yeah. this undoes that thing. that's the whole vibe. it's the "undo" button for the effects of SDL_RegisterApp 🫢

but listen. most applications do not need to call this directly, and honestly they should not. lowkey stay out of it. SDL handles this itself β€” it calls this function for you when it's deinitializing the video subsystem. so unless you're doing something extremely specific, hands off, bestie πŸ™ˆ

now, is it safe to call more than once? yes ma'am ✨ it is safe to call this multiple times β€” as long as every single call is eventually paired with a prior call to SDL_RegisterApp. it's giving "every goodbye needs a hello first." no unpaired calls, no chaos πŸ’€

and here's the actual mechanic, pay attention: the window class will only be deregistered when the registration counter in SDL_RegisterApp decrements to zero through calls to this function. so she's counting down. one call, one decrement. zero means done. not before. periodt πŸ’…


πŸ”₯ THREAD SAFETY πŸ”₯

this function is not thread safe. do not. do not do the multithread thing with her. she is one lane only 🚫🧡


⭐ AVAILABILITY ⭐

this function has been available since SDL 3.2.0 β€” so if you're on anything older, she simply does not exist for you, sorry babe 😭


and that's the whole page, no cap. this was brought to you by the lovely humans at Simple Directmedia Layer, running SDL 3.4.18 β€” mwah, thanks for reading, go pair your calls, and stay deregistered πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from