SDL_GetNumberProperty(3)
π SDL_GetNumberProperty π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we are pulling a number property out of a whole lil group of properties β¨ it's giving "reach into the bag and grab the number" energy and honestly? obsessed.
β¨ NAME β¨
SDL_GetNumberProperty β get a number property from a group of properties π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_properties.h>
Sint64 SDL_GetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 default_value);
β¨ DESCRIPTION β¨
so like, you hand it a property name, it hands you back a number. slay. π
and if you're sitting there like "bestieβ¦ does this property even exist?? is it even a number tho??" β you can use SDL_GetPropertyType() to query whether the property exists and is a number property π¦ no guessing required, no cap.
β¨ FUNCTION PARAMETERS β¨
propsβ the properties to query πΈ like, the whole group you're digging through.nameβ the name of the property to query π the one you're looking for by name, main character style.default_valueβ the default value of the property π your lil fallback bff, waiting patiently in case things don't work out.
β¨ RETURN VALUE β¨
Returns the value of the property π₯ or, if it is not set or not a number property, it just gives you back default_value π«Ά no drama, no crash, just the fallback. periodt.
β¨ THREAD SAFETY β¨
It is safe to call this function from any thread π fr fr, any thread, go wild, call it from wherever you want. iconic behaviour honestly.
β¨ AVAILABILITY β¨
This function is available since SDL 3.2.0 β so if you're on something olderβ¦ yeah, that's a vibe check you're failing, bestie π
β¨ SEE ALSO β¨
SDL_GetPropertyType(3)πSDL_HasProperty(3)β¨SDL_SetNumberProperty(3)π
iykyk β go read those next, they're the whole friend group π¦
lowkey important: this one only does numbers. if the property is set but it's a different type, you're getting default_value back, not a surprise conversion. π
and that's the whole page bestie!! brought to you by Simple Directmedia Layer π running the SDL 3.4.18 era, and yes this is SDL_GetNumberProperty(3) signing off π go get those numbers, you ate π
πΈ
π¦ 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