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