COMMON: Add getHiDPIScreenFactor to OSystem

This commit is contained in:
Thierry Crozat 2021-07-12 13:36:11 +01:00
parent f20c9ab958
commit 6d8462674f
4 changed files with 13 additions and 0 deletions

View File

@ -101,6 +101,7 @@ public:
virtual void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) = 0;
virtual int16 getOverlayHeight() const = 0;
virtual int16 getOverlayWidth() const = 0;
virtual float getHiDPIScreenFactor() const { return 1.0f; }
virtual bool showMouse(bool visible) = 0;
virtual void warpMouse(int x, int y) = 0;

View File

@ -243,6 +243,10 @@ int16 ModularGraphicsBackend::getOverlayWidth() {
return _graphicsManager->getOverlayWidth();
}
float ModularGraphicsBackend::getHiDPIScreenFactor() const {
return _graphicsManager->getHiDPIScreenFactor();
}
bool ModularGraphicsBackend::showMouse(bool visible) {
return _graphicsManager->showMouse(visible);
}

View File

@ -114,6 +114,8 @@ public:
virtual int16 getOverlayHeight() override final;
virtual int16 getOverlayWidth() override final;
virtual float getHiDPIScreenFactor() const override final;
virtual bool showMouse(bool visible) override final;
virtual void warpMouse(int x, int y) override final;
virtual void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) override final;

View File

@ -1052,6 +1052,12 @@ public:
*/
virtual PaletteManager *getPaletteManager() = 0;
/**
* Return the scale factor for HiDPI screens.
* Returns 1 for non-HiDPI screens, or if HiDPI display is not supported by the backend.
*/
virtual float getHiDPIScreenFactor() const { return 1.0f; }
/**
* Blit a bitmap to the virtual screen.
*