From 55a1e38717a3273487ec1501e4c454d7730d1fd3 Mon Sep 17 00:00:00 2001 From: Yamagi Date: Fri, 29 Mar 2024 10:37:37 +0100 Subject: [PATCH] Port GetWindowSize() to SDL 3. --- src/client/vid/glimp_sdl3.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/client/vid/glimp_sdl3.c b/src/client/vid/glimp_sdl3.c index 667e5f69..d3ecd92a 100644 --- a/src/client/vid/glimp_sdl3.c +++ b/src/client/vid/glimp_sdl3.c @@ -32,6 +32,7 @@ * * Do we need to request High DPI modes when vid_highdpiaware > 0? * * `fullscreen` should be an enum to make the code more readable. * * Debug fullscreen handling, maybe refactor it further. + * * Check if window size handling is correct. */ #include "../../common/header/common.h" @@ -236,18 +237,12 @@ GetWindowSize(int* w, int* h) return false; } - SDL_DisplayMode m; - - if (SDL_GetWindowFullscreenMode(window, &m) != 0) + if (SDL_GetWindowSize(window, w, h) < 0) { - Com_Printf("Can't get Displaymode: %s\n", SDL_GetError()); - + Com_Printf("Couldn't get window size: %s\n", SDL_GetError()); return false; } - *w = m.w; - *h = m.h; - return true; }