From d54b61dc7a90ef32cbe97002bf2c2af836116b9c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 28 Sep 2021 23:54:10 +0300 Subject: [PATCH] SDL: Fix full screen toggling for 3D games The previous SdlGraphics3dManager::toggleFullScreen() was not using beginGFXTransaction / endGFXTransaction in toggleFullScreen(). Restore this logic for 3D games, as using transactions in such games results in a black screen for 3D games when switching to full screen A regression from d33487f64 --- backends/graphics/sdl/sdl-graphics.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 8a55e634045..4f185e34744 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -401,9 +401,13 @@ void SdlGraphicsManager::toggleFullScreen() { return; } - beginGFXTransaction(); + bool is3D = g_system->hasFeature(OSystem::kFeatureOpenGLForGame); + + if (!is3D) + beginGFXTransaction(); setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode)); - endGFXTransaction(); + if (!is3D) + endGFXTransaction(); #ifdef USE_OSD if (getFeatureState(OSystem::kFeatureFullscreenMode)) displayMessageOnOSD(_("Fullscreen mode"));