SDL_SetAppMetadata(3)
π NAME π
SDL_SetAppMetadata β bestie, this is how you tell SDL the basics about your app. Like, who even are you? π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_init.h>
bool SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier);
πΈ DESCRIPTION πΈ
Okay so, you can optionally hand SDL some metadata about your app. Is it required? Nope. Is it strongly encouraged? Fr fr, yes. π
There are lowkey so many places SDL can actually use this stuff β think an "About" box chilling in the macOS menu bar, your app's name showing up on some audio mixers, etc. And here's the slay part: any single piece of metadata can just be NULL if that specific detail doesn't make sense for your app. No pressure. π¦
β οΈ Call this function as early as possible, like before SDL_Init. Do not wait. Not the vibe to be late.
Multiple calls to this function are allowed, but heads up β various state might not change once it's been set up with a previous call to this function. So like, don't expect a glow-up after the fact. π
Passing a NULL removes any previous metadata. Poof. Gone. β¨
Also this is the simplified interface for the most important info. If you want significantly more detailed metadata, go use SDL_SetAppMetadataProperty() instead. It's giving deluxe edition. π
π«Ά FUNCTION PARAMETERS π«Ά
appnameβ the name of the application (like"My Game 2: Bad Guy's Revenge!"). Your main character moment. πappversionβ the version of the application (think"1.0.0beta5", or a git hash, or literally whatever makes sense for you). πappidentifierβ a unique string in reverse-domain format that identifies this app (e.g."com.example.mygame2"). Yes bestie, reverse-domain. It's the rules. π
π₯ RETURN VALUE π₯
Returns true on success or false on failure β and if it fails, call SDL_GetError() for more info. She will tell you what went wrong, no cap. π
π§ THREAD SAFETY π§
It is safe to call this function from any thread. Multithreaded girlies, this one's for you. π
β AVAILABILITY β
This function is available since SDL 3.2.0. So if you're on anything olderβ¦ girl, upgrade. π
π« SEE ALSO π«
That's the whole page, bestie β go forth and give your app its identity. π
With love from the Simple Directmedia Layer crew, rocking SDL 3.4.18. π«Άπ
π¦ 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