SDL_SetInitialized(3)

πŸ’– SDL_SetInitialized β€” the glow-up moment for your init state πŸ’–

okay bestie, welcome to the SDL3 manual, and specifically to SDL_SetInitialized(3), which lives in the SDL3 FUNCTIONS section. this one is short but she is important, so let's get into it 🫢


✨ NAME ✨

SDL_SetInitialized β€” finish an initialization state transition. like, the transition? done. wrapped. periodt. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_mutex.h>

void SDL_SetInitialized(SDL_InitState *state, bool initialized);

no return value, no drama, just vibes and a state change ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea πŸ“ β€” this function takes the status of the state you passed in and sets it to SDL_INIT_STATUS_INITIALIZED or SDL_INIT_STATUS_UNINITIALIZED. that's it, that's the whole job, and she does it flawlessly.

and the best part? while she's doing that, she allows any threads waiting for the status to proceed. so all those lil threads that were just sitting there, waiting for the vibe check to clear? they get to move on. iconic behavior, honestly. πŸ‘‘


πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • state β€” the initialization state to check. this is your lil state object, she's the main character here.
  • initialized β€” the new initialization state. true? false? you decide, bestie, it's your world 🌈

πŸ”₯ THREAD SAFETY πŸ”₯

it is safe to call this function from any thread. any of them. all of them. go off, no cap πŸ™ˆβœ¨


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on something older... yeah, she's not there yet, sorry babe 😭


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're the sister functions and they ate πŸ’…


mwah πŸ’‹ that's the whole page! brought to you by the lovely folks at Simple Directmedia Layer, running SDL 3.4.18, and yeah this is SDL_SetInitialized(3) signing off. stay initialized, bestie πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from