Fixed some more fullscreen
There is still a slight offset. I need to practice maths I think
This commit is contained in:
parent
f9556cbf59
commit
5a8c1ece14
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,10 +25,16 @@ endif ()
|
|||
|
||||
include_directories(${STEAMWORKS_INCLUDE_DIR})
|
||||
|
||||
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})
|
||||
|
||||
|
|
Loading…
Reference in New Issue