SDL_GetBooleanProperty(3)

πŸ’– SDL_GetBooleanProperty πŸ’–

okay bestie, welcome to the SDL_GetBooleanProperty(3) page, straight out of the SDL3 FUNCTIONS lineup ✨ this one's a little cutie from <SDL3/SDL_properties.h> and she's about to hand you a bool like it's nothing.


🌸 NAME 🌸

SDL_GetBooleanProperty β€” get a boolean property from a group of properties. that's it, that's the whole job, and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_properties.h>

bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, bool default_value);

look at that signature. clean. iconic. no notes 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: you call this and she goes and fetches the boolean property for you. simple. slay.

but lowkey, if you wanna be that girl and check whether the property actually exists and is truly a boolean property before you go grabbing it β€” you can use SDL_GetPropertyType() to query that. it's giving responsible main character energy πŸ”₯


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • props β€” the properties to query. this is your group of properties, your little squad, the whole vibe check container πŸ’œ
  • name β€” the name of the property to query. yes bestie, you gotta know her name, iykyk 🌸
  • default_value β€” the default value of the property. this is your backup plan, your safety net, your "if she's not there i'm still fine" moment πŸ™ˆ

⭐ RETURN VALUE ⭐

she returns the value of the property πŸŽ‰ β€” OR, and hear me out, default_value if it is not set or not a boolean property. so like, no surprises, no undefined chaos, you always get something back. periodt.


🌈 THREAD SAFETY 🌈

it is safe to call this function from any thread. any of them. all of them. go wild, queen πŸ‘‘ no cap.


πŸ’« AVAILABILITY πŸ’«

this function is available since SDL 3.2.0. so if you're on something older... bestie, upgrade, it's not that deep 😭


🧚 SEE ALSO 🧚

the whole friend group fr fr πŸ’• go read them too, they're all serving.


πŸ’€ reminder: the facts above are the facts, no embellishment, no invented behaviour. i just made them cuter. that's the whole assignment. πŸŽ€

okay bye, ily, this page was brought to you by Simple Directmedia Layer, version SDL 3.4.18, and by the SDL_GetBooleanProperty(3) girlies πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from