diff options
author | Cameron Cawley | 2019-11-01 11:39:46 +0000 |
---|---|---|
committer | Antoniou Athanasios | 2019-11-01 13:39:46 +0200 |
commit | 177d709909808313eee720ce76465cf99f909c5e (patch) | |
tree | 6d11f166342ddea46deb1634b106d010b4ab5181 /backends/graphics/openglsdl | |
parent | 5d0206b9c297837fddb038601bdfb42b0fcb8016 (diff) | |
download | scummvm-rg350-177d709909808313eee720ce76465cf99f909c5e.tar.gz scummvm-rg350-177d709909808313eee720ce76465cf99f909c5e.tar.bz2 scummvm-rg350-177d709909808313eee720ce76465cf99f909c5e.zip |
OPENGL: Implement high DPI support on Android (#1895)
* OPENGL: Implement high DPI support on Android
* PSP2: Fix build
Diffstat (limited to 'backends/graphics/openglsdl')
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.cpp | 14 | ||||
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 2d2a1bac7b..d959e021e6 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -305,7 +305,8 @@ void OpenGLSdlGraphicsManager::notifyResize(const int width, const int height) { getWindowSizeFromSdl(¤tWidth, ¤tHeight); if (width != currentWidth || height != currentHeight) return; - handleResize(width, height); + // TODO: Implement high DPI support + handleResize(width, height, 90, 90); #else if (!_ignoreResizeEvents && _hwScreen && !(_hwScreen->flags & SDL_FULLSCREEN)) { // We save that we handled a resize event here. We need to know this @@ -357,9 +358,9 @@ void *OpenGLSdlGraphicsManager::getProcAddress(const char *name) const { return SDL_GL_GetProcAddress(name); } -void OpenGLSdlGraphicsManager::handleResizeImpl(const int width, const int height) { - OpenGLGraphicsManager::handleResizeImpl(width, height); - SdlGraphicsManager::handleResizeImpl(width, height); +void OpenGLSdlGraphicsManager::handleResizeImpl(const int width, const int height, const int xdpi, const int ydpi) { + OpenGLGraphicsManager::handleResizeImpl(width, height, xdpi, ydpi); + SdlGraphicsManager::handleResizeImpl(width, height, xdpi, ydpi); } bool OpenGLSdlGraphicsManager::saveScreenshot(const Common::String &filename) const { @@ -463,7 +464,8 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { notifyContextCreate(rgba8888, rgba8888); int actualWidth, actualHeight; getWindowSizeFromSdl(&actualWidth, &actualHeight); - handleResize(actualWidth, actualHeight); + // TODO: Implement high DPI support + handleResize(actualWidth, actualHeight, 90, 90); return true; #else // WORKAROUND: Working around infamous SDL bugs when switching @@ -510,7 +512,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { if (_hwScreen) { notifyContextCreate(rgba8888, rgba8888); - handleResize(_hwScreen->w, _hwScreen->h); + handleResize(_hwScreen->w, _hwScreen->h, 90, 90); } // Ignore resize events (from SDL) for a few frames, if this isn't diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h index 2729a529fd..929adc9292 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.h +++ b/backends/graphics/openglsdl/openglsdl-graphics.h @@ -60,7 +60,7 @@ protected: virtual void *getProcAddress(const char *name) const override; - virtual void handleResizeImpl(const int width, const int height) override; + virtual void handleResizeImpl(const int width, const int height, const int xdpi, const int ydpi) override; virtual bool saveScreenshot(const Common::String &filename) const override; |