SDL_GetVersion(3)
π SDL_GetVersion π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_GetVersion β she's short, she's sweet, and she tells you exactly which SDL you're actually cuddling with at runtime. let's get into it π¦
β¨ NAME β¨
SDL_GetVersion β get the version of SDL that is linked against your program.
like, not the one you thought you had. the one you actually have. vibe check for your shared library π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_version.h>
int SDL_GetVersion(void);
no args, no drama, no parameters. she just knows π
π« DESCRIPTION π«
so here's the tea, and it's genuinely important tea: if you're linking to SDL dynamically, then it's totally possible that the current version is different from the version you compiled against. like, you built your whole thing against one SDL and then the system hands you another one at runtime. rude? maybe. real? absolutely π
SDL_GetVersion returns the current version β the one actually linked against your program right now.
meanwhile SDL_VERSION is the version you compiled with. two different girls, two different jobs. don't mix them up, i'm begging π
the way that this function may be called safely at any time, even before SDL_Init(). no setup, no init, no waiting. she's ready whenever you are, lowkey iconic β
π RETURN VALUE π
returns the version of the linked library. that's it, that's the whole return. the version of the linked library π«Ά
π§ THREAD SAFETY π§
it is safe to call this function from any thread. all of them. every single one. she's not picky, she's not messy, she's just built different π
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on something older... bestie. no cap. you gotta update π
β¨
π SEE ALSO π
SDL_GetRevision(3)β the other girl in the friend group, go say hi π
Simple Directmedia Layer πΈ SDL 3.4.18 πΈ SDL_GetVersion(3)
and that's the whole page, bestie!! written by the Simple Directmedia Layer girlies, version SDL 3.4.18, and yes this is the SDL_GetVersion(3) page you just read, so you're already here, slay ππ
β¨
π¦ 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