diff --git a/renderer/HardwareBaseGPU.cpp b/renderer/HardwareBaseGPU.cpp index e8e75e9c..52305b71 100644 --- a/renderer/HardwareBaseGPU.cpp +++ b/renderer/HardwareBaseGPU.cpp @@ -347,18 +347,17 @@ int rend_SetPreferredState(renderer_preferred_state *pref_state, bool reinit) { if (gpu_state.initted) { LOG_DEBUG << "Inside pref state!"; - // Change gamma if needed - if (pref_state->width != gpu_state.screen_width || pref_state->height != gpu_state.screen_height || - old_state.bit_depth != pref_state->bit_depth) { - reinit = true; + if (old_state.fullscreen != pref_state->fullscreen) { + rend_SetFullScreen(pref_state->fullscreen); } - if (reinit) { - retval = rend_ReInit(); - } else if (old_state.gamma != pref_state->gamma) { + if (pref_state->width != gpu_state.screen_width || pref_state->height != gpu_state.screen_height || + old_state.bit_depth != pref_state->bit_depth || reinit) { + rend_ReInit(); + } + + if (old_state.gamma != pref_state->gamma) { rend_SetGammaValue(pref_state->gamma); - } else if (old_state.fullscreen != pref_state->fullscreen) { - rend_SetFullScreen(pref_state->fullscreen); } } else { gpu_preferred_state = *pref_state; diff --git a/renderer/HardwareOpenGL.cpp b/renderer/HardwareOpenGL.cpp index e05af6af..3f50525d 100644 --- a/renderer/HardwareOpenGL.cpp +++ b/renderer/HardwareOpenGL.cpp @@ -443,7 +443,7 @@ int opengl_Setup(oeApplication *app, const int *width, const int *height) { SDL_SetWindowRelativeMouseMode(GSDLWindow, grabMouse); SDL_SetWindowKeyboardGrab(GSDLWindow, grabMouse); - SDL_SetWindowFullscreen(GSDLWindow, Game_fullscreen); + rend_SetFullScreen(Game_fullscreen); } else if (!Game_fullscreen) { SDL_SetWindowSize(GSDLWindow, winw, winh); } @@ -1140,6 +1140,7 @@ void rend_SetGammaValue(float val) { void rend_SetFullScreen(bool fullscreen) { if (GSDLWindow) { SDL_SetWindowFullscreen(GSDLWindow, fullscreen); + SDL_SyncWindow(GSDLWindow); } if (fullscreen) {