Skip to content

Commit

Permalink
SDL/OpenGL - actually use the window resolution from the json (Harbou…
Browse files Browse the repository at this point in the history
…rMasters#1082)

* actually use the window resolution from the json

* switch fix

Co-authored-by: briaguya <briaguya@alice>
  • Loading branch information
briaguya-ai and briaguya authored Aug 8, 2022
1 parent 9b33827 commit cf639b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cf639b1

Please sign in to comment.