SDL_WasInit(3)

πŸ’– SDL_WasInit(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_WasInit β€” she's literally just here to tell you what's already up and running ✨


🌸 NAME 🌸

SDL_WasInit β€” get a mask of the specified subsystems which are currently initialized 🫢

(yeah she's nosy, but in a helpful way. she checks who's already at the party πŸŽ€)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_init.h>

SDL_InitFlags SDL_WasInit(SDL_InitFlags flags);

πŸ’… FUNCTION PARAMETERS πŸ’…

  • flags β€” any of the flags used by SDL_Init(); see SDL_Init for details πŸ‘‘ like, whatever flags you'd throw at SDL_Init, she'll accept them here too. same energy, same set, no cap.

✨ RETURN VALUE ✨

Returns a mask of all initialized subsystems if flags is 0 πŸ’– otherwise it returns the initialization status of the specified subsystems 🌈

so basically: pass 0 and she spills the tea on everything that's initialized, pass actual flags and she only reports on the ones you asked about. lowkey iconic behavior.


πŸ”₯ THREAD SAFETY πŸ”₯

This function is not thread safe. πŸ’€

fr fr, do not come for her from multiple threads at once, she is not built for that chaos. keep it single-threaded or wrap it up yourself, bestie.


🌟 AVAILABILITY 🌟

This function is available since SDL 3.2.0 πŸŽ€ so if you're on anything older, she's not there yet, sorry bestie 😭


πŸ‘‘ SEE ALSO πŸ‘‘

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


Simple Directmedia Layer πŸ¦‹ this whole thing is living in SDL 3.4.18, and the original page signed off as SDL_WasInit(3) β€” so yeah, that's the vibe, mwah πŸ’–βœ¨ no cap, periodt.

πŸ“¦ where this page comes from