aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl/surfacesdl-graphics.h
diff options
context:
space:
mode:
authorColin Snover2017-02-12 19:17:33 -0600
committerColin Snover2017-07-06 19:11:54 -0500
commit332fabcb8a0ff3957f0198ad3b93b4f3861f7eba (patch)
tree0568f55085e32c4a6497edfb986ef635f9f4351a /backends/graphics/surfacesdl/surfacesdl-graphics.h
parent6d37e1e88cf5c34e48c47cba74c21f89daa94178 (diff)
downloadscummvm-rg350-332fabcb8a0ff3957f0198ad3b93b4f3861f7eba.tar.gz
scummvm-rg350-332fabcb8a0ff3957f0198ad3b93b4f3861f7eba.tar.bz2
scummvm-rg350-332fabcb8a0ff3957f0198ad3b93b4f3861f7eba.zip
SDL: Only recreate SDL2 window when necessary
Destroying and recreating the SDL window whenever the video mode changes in SDL2 is not necessary and causes several problems: 1. In windowed mode, the game window shifts position; 2. In fullscreen mode in macOS, every time the window is recreated, it causes the OS to play its switch-to-fullscreen animation again and emit system alert noises; 3. The window content flickers; and 4. The engine loses events from the old destroyed window. This patch changes the SDL backend code to avoid destroying and recreating the SDL window when using SDL2, except when switching OpenGL modes, since there is no way to change the OpenGL feature of a window. There are still some outstanding issues with OpenGL where window size ends up getting reset even though the user has resized it; this will probably need to be addressed at some point in another patch. Thanks to @bgK and @criezy for their feedback which made this patch much better. Co-Authored-By: Bastien Bouclet <bastien.bouclet@gmail.com>
Diffstat (limited to 'backends/graphics/surfacesdl/surfacesdl-graphics.h')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index fa130cd9a5..532399ed66 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -156,9 +156,7 @@ public:
// SdlGraphicsManager interface
virtual void notifyVideoExpose();
-#ifdef USE_SDL_RESIZABLE_WINDOW
virtual void notifyResize(const uint width, const uint height);
-#endif
virtual void transformMouseCoordinates(Common::Point &point);
virtual void notifyMousePos(Common::Point mouse);