diff --git a/src/main.c b/src/main.c index 0f682e8..3aeda2d 100644 --- a/src/main.c +++ b/src/main.c @@ -558,16 +558,19 @@ toggle_fullscreen(void) settings->fullscreen_enabled = false; } else { - int w, h; + int w, h, lw, lh; + SDL_RenderGetLogicalSize(gRenderer, &lw, &lh); SDL_GetWindowSize(gWindow, &w, &h); + double lratio = w / lw; + SDL_SetWindowFullscreen(gWindow, SDL_WINDOW_FULLSCREEN_DESKTOP); SDL_DisplayMode dMode; SDL_GetWindowDisplayMode(gWindow, &dMode); double ratio = (double) (dMode.w) / w; double offset = ((dMode.w - w) / 2); - initViewports((Uint32)((offset)/(ratio*2))); + initViewports((Uint32)((offset)/(ratio*lratio))); settings->fullscreen_enabled = true; } } diff --git a/steamworks_c_wrapper/CMakeLists.txt b/steamworks_c_wrapper/CMakeLists.txt index acf2d8a..4199e59 100644 --- a/steamworks_c_wrapper/CMakeLists.txt +++ b/steamworks_c_wrapper/CMakeLists.txt @@ -25,10 +25,16 @@ endif () include_directories(${STEAMWORKS_INCLUDE_DIR}) -add_library(steamworks_c_wrapper - SHARED - src/steamworks_c_wrapper - ) +if (WIN32) + add_library(steamworks_c_wrapper + src/steamworks_c_wrapper + ) +else () + add_library(steamworks_c_wrapper + SHARED + src/steamworks_c_wrapper + ) +endif() target_link_libraries(steamworks_c_wrapper ${STEAMWORKS_LIBRARY})