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 <briaguya@alice>
This commit is contained in:
briaguya 2022-08-08 19:46:37 -04:00 committed by GitHub
parent 9b33827d02
commit cf639b1d51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);