瀏覽代碼

snake: Add basic app metadata

All SDL3 applications and games should ideally have this.

Signed-off-by: Simon McVittie <[email protected]>
Simon McVittie 11 月之前
父節點
當前提交
ca82405d5a
共有 1 個文件被更改,包括 4 次插入0 次删除
  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;
     }