From cf639b1d51b27187f6c5186a07f4414000fd7522 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Mon, 8 Aug 2022 19:46:37 -0400 Subject: [PATCH] SDL/OpenGL - actually use the window resolution from the json (#1082) * actually use the window resolution from the json * switch fix Co-authored-by: briaguya --- libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp index 23cff4698e3..76573c0845f 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp @@ -166,10 +166,12 @@ static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen, uint32 #ifdef __SWITCH__ // For Switch we need to set the window width before creating the window Ship::Switch::GetDisplaySize(&window_width, &window_height); + width = window_width; + height = window_height; #endif wnd = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, - window_width, window_height, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); + width, height, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); #ifndef __SWITCH__ SDL_GL_GetDrawableSize(wnd, &window_width, &window_height);