Browse Source

snake: Add basic app metadata

All SDL3 applications and games should ideally have this.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Simon McVittie 6 months ago
parent
commit
ca82405d5a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      examples/game/01-snake/snake.c

+ 4 - 0
examples/game/01-snake/snake.c

@@ -283,6 +283,10 @@ SDL_AppResult SDL_AppIterate(void *appstate)
 
 SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
 {
+    if (!SDL_SetAppMetadata("Example Snake game", "1.0", "com.example.Snake")) {
+        return SDL_APP_FAILURE;
+    }
+
     if (!SDL_Init(SDL_INIT_VIDEO)) {
         return SDL_APP_FAILURE;
     }