From 177d709909808313eee720ce76465cf99f909c5e Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Fri, 1 Nov 2019 11:39:46 +0000 Subject: OPENGL: Implement high DPI support on Android (#1895) * OPENGL: Implement high DPI support on Android * PSP2: Fix build --- backends/graphics/windowed.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'backends/graphics/windowed.h') diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h index 74933a1727..549739d987 100644 --- a/backends/graphics/windowed.h +++ b/backends/graphics/windowed.h @@ -49,6 +49,8 @@ public: _cursorVisible(false), _cursorX(0), _cursorY(0), + _xdpi(90), + _ydpi(90), _cursorNeedsRedraw(false), _cursorLastInActiveArea(true) {} @@ -93,7 +95,7 @@ protected: * Backend-specific implementation for updating internal surfaces that need * to reflect the new window size. */ - virtual void handleResizeImpl(const int width, const int height) = 0; + virtual void handleResizeImpl(const int width, const int height, const int xdpi, const int ydpi) = 0; /** * Converts the given point from the active virtual screen's coordinate @@ -172,10 +174,12 @@ protected: * @param width The new width of the window, excluding window decoration. * @param height The new height of the window, excluding window decoration. */ - void handleResize(const int width, const int height) { + void handleResize(const int width, const int height, const int xdpi, const int ydpi) { _windowWidth = width; _windowHeight = height; - handleResizeImpl(width, height); + _xdpi = xdpi; + _ydpi = ydpi; + handleResizeImpl(width, height, xdpi, ydpi); } /** @@ -275,6 +279,11 @@ protected: */ int _windowHeight; + /** + * The DPI of the window. + */ + int _xdpi, _ydpi; + /** * Whether the overlay (i.e. launcher, including the out-of-game launcher) * is visible or not. -- cgit v1.2.3