diff options
author | Johannes Schickel | 2015-12-18 19:08:26 +0100 |
---|---|---|
committer | Johannes Schickel | 2015-12-18 19:12:11 +0100 |
commit | 366e164705a920ccd5de9dc606399f9c5b54913c (patch) | |
tree | 344dfc05633795f58e576f6fb4f4c253ce8a2a19 /backends/graphics/surfacesdl/surfacesdl-graphics.h | |
parent | ef62422e59d691c944838f9da3ac868821d4797c (diff) | |
download | scummvm-rg350-366e164705a920ccd5de9dc606399f9c5b54913c.tar.gz scummvm-rg350-366e164705a920ccd5de9dc606399f9c5b54913c.tar.bz2 scummvm-rg350-366e164705a920ccd5de9dc606399f9c5b54913c.zip |
SDL: Implement initial support for resizable window with SDL2.
The code is disabled for now.
Diffstat (limited to 'backends/graphics/surfacesdl/surfacesdl-graphics.h')
-rw-r--r-- | backends/graphics/surfacesdl/surfacesdl-graphics.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h index ac9844c849..c4f7346525 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.h +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h @@ -39,6 +39,15 @@ #define USE_SDL_DEBUG_FOCUSRECT #endif +// We have (some) support for resizable windows when SDL2 is used. However +// the overlay still uses the resolution setup with SDL_SetVideoMode. This +// makes the GUI look subpar when the user resizes the window. In addition +// we do not adapt the scale factor right now. Thus, we disable this code +// path for now. +#if SDL_VERSION_ATLEAST(2, 0, 0) && 0 +#define USE_SDL_RESIZABLE_WINDOW +#endif + #if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) // Uncomment this to enable the 'on screen display' code. #define USE_OSD 1 @@ -143,6 +152,9 @@ 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); @@ -174,6 +186,7 @@ protected: SDL_Rect _viewport; int _windowWidth, _windowHeight; void deinitializeRenderer(); + void setWindowResolution(int width, int height); SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags); void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects); |