aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl/surfacesdl-graphics.h
diff options
context:
space:
mode:
authorThierry Crozat2018-05-12 19:57:21 +0100
committerThierry Crozat2018-07-08 16:54:51 +0100
commit812ce59ee44d669d2b17a1c1602f9364900b9479 (patch)
treed1a7b66bc186a5c892c67e281a502a997246f369 /backends/graphics/surfacesdl/surfacesdl-graphics.h
parent8526c2c31a07e57f7166047a87474bffd82e8a03 (diff)
downloadscummvm-rg350-812ce59ee44d669d2b17a1c1602f9364900b9479.tar.gz
scummvm-rg350-812ce59ee44d669d2b17a1c1602f9364900b9479.tar.bz2
scummvm-rg350-812ce59ee44d669d2b17a1c1602f9364900b9479.zip
SDL: Implement stretch mode API
Four modes are supported: - Use original size with no scaling - Scale by an integral amount as much as possible but not bigger than the window. - Scale to fit the window while respecting the aspect ratio. There may be black bars on the left and right, or on the top and bottom, but not both. This is the default, and the old behaviour. - Scale and stretch to fit the window. In this mode the aspecy ratio is not respected and there is no black bars. The mode is controled by the "scaling_mode" value (between 0 and 3) in the config file. Also add Crtl-Alt-s hotkey to cycle through scaling modes
Diffstat (limited to 'backends/graphics/surfacesdl/surfacesdl-graphics.h')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 9e8e75772d..6e7fec4823 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -98,6 +98,12 @@ public:
virtual const OSystem::GraphicsMode *getSupportedShaders() const override;
virtual int getShader() const override;
virtual bool setShader(int id) override;
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ virtual const OSystem::GraphicsMode *getSupportedStretchModes() const override;
+ virtual int getDefaultStretchMode() const override;
+ virtual bool setStretchMode(int mode) override;
+ virtual int getStretchMode() const override;
+#endif
virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL) override;
virtual int getScreenChangeID() const override { return _screenChangeCount; }
@@ -174,6 +180,9 @@ protected:
virtual bool gameNeedsAspectRatioCorrection() const override {
return _videoMode.aspectRatioCorrection;
}
+ virtual int getGameRenderScale() const override {
+ return _videoMode.scaleFactor;
+ }
virtual void handleResizeImpl(const int width, const int height) override;
@@ -225,6 +234,7 @@ protected:
bool needUpdatescreen;
#if SDL_VERSION_ATLEAST(2, 0, 0)
bool needTextureUpdate;
+ bool needDisplayResize;
#endif
#ifdef USE_RGB_COLOR
bool formatChanged;
@@ -241,6 +251,7 @@ protected:
#if SDL_VERSION_ATLEAST(2, 0, 0)
bool filtering;
+ int stretchMode;
#endif
int mode;