SDL_GetStringProperty(3)
β¨ SDL_GetStringProperty(3) β¨
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual π this one is called SDL_GetStringProperty, and it's literally just "hey, what's that string property set to?" but make it a whole manpage. no cap.
πΈ NAME πΈ
SDL_GetStringProperty β get a string property from a group of properties. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_properties.h>
const char * SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value);
look at her. three args, returns a const char *, does exactly one job and does it slay π
π FUNCTION PARAMETERS π
propsβ the properties you wanna query, aka the lil group you're digging through π«Άnameβ the name of the property you're asking about. yes, by name. iconic behavior.default_valueβ the fallback value for the property. your safety net, your emotional support string π
π RETURN VALUE π
Returns the value of the property β ate β OR it returns default_value if it's not set, or if it's set but it's not a string property. so like, if it's not giving string, you get the default. periodt π
π₯ THREAD SAFETY π₯
okay so this is the part where we get real for a sec:
It's safe to call this function from any thread β
. BUT (and this is a big but) the data returned is not protected, and it could potentially be freed if you call SDL_SetStringProperty() or SDL_ClearProperty() on these properties from another thread. π the audacity.
If you need to avoid that whole situation, useSDL_LockProperties()andSDL_UnlockProperties(). lock in, bestie πβ¨
π AVAILABILITY π
This function has been available since SDL 3.2.0. so if you're on something older... girl, upgrade π
π SEE ALSO π
go read those too, they're all in the same friend group π«Ά
and that's the page!! brought to you by Simple Directmedia Layer, running the SDL 3.4.18 era, mwah π bye bestie, go read a property π¦β¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms