SDL_GetPlatform(3)
π SDL_GetPlatform(3) β the SDL3 FUNCTIONS glow-up π
okay bestie, buckle up, we're doing a manual page and it's literally gonna be fun. this is SDL_GetPlatform, from the SDL3 FUNCTIONS collection. it answers the most iconic question of all time: what platform am i even on rn?? π¦
πΈ NAME πΈ
SDL_GetPlatform β get the name of the platform. that's it. that's the whole job. she's simple, she's reliable, she ate π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_platform.h>
const char * SDL_GetPlatform(void);
no args, no drama, no parameters. she takes nothing and gives you a string. queen behavior π
π DESCRIPTION π
so here's the tea β this function hands you back the name of the platform you're running on. and here are the names it returns for some (but not all) of the supported platforms, bestie:
"Windows""macOS""Linux""iOS""Android"
not me emphasizing "some (but not all)" β that's straight from the source, don't come for me. there are more platforms out there, these are just the ones the docs are showing off π
π RETURN VALUE π
returns the name of the platform. simple, clean, gorgeous.
but β and this is important β if the correct platform name is not available, it returns a string that begins with the text "Unknown". so like, if you see something starting with "Unknown", that's your sign that the platform name wasn't there. keep an eye out for it, iykyk π
π§ THREAD SAFETY π§
it is safe to call this function from any thread. literally any of them. go feral, call it from all of them at once, she does not care. iconic multi-threaded energy π
β AVAILABILITY β
this function is available since SDL 3.2.0. if you're on anything older... bestie, we need to talk π
π«Ά SEE ALSO π«Ά
okay so the original page didn't give us a SEE ALSO section, which is honestly a little tragic, but we move. you've got everything you need right here anyway π
and that's the whole page, no cap!! sending you off with love from the Simple Directmedia Layer crew β this was SDL 3.4.18, dated SDL_GetPlatform(3), and yes she's still serving. go forth and platform-detect responsibly, bestie πβ¨π¦π π₯ππβππ
π¦ 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