diff --git a/src/SDL.c b/src/SDL.c index 24c6f4dfd..b8be679be 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -500,13 +500,21 @@ SDL_Quit(void) void SDL_GetVersion(SDL_version * ver) { + static SDL_bool check_hint = SDL_TRUE; + static SDL_bool legacy_version = SDL_FALSE; + if (!ver) { return; } SDL_VERSION(ver); - if (SDL_GetHintBoolean("SDL_LEGACY_VERSION", SDL_FALSE)) { + if (check_hint) { + check_hint = SDL_FALSE; + legacy_version = SDL_GetHintBoolean("SDL_LEGACY_VERSION", SDL_FALSE); + } + + if (legacy_version) { /* Prior to SDL 2.24.0, the patch version was incremented with every release */ ver->patch = ver->minor; ver->minor = 0;