OPENGLSDL: Fix increasing/decreasing the window size on macOS

This commit is contained in:
Thierry Crozat 2021-07-16 13:17:59 +01:00
parent c1a2d5ba1b
commit 2a410768ad

View File

@ -636,6 +636,13 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
// window. Then we apply the direction change.
int windowWidth = 0, windowHeight = 0;
getWindowSizeFromSdl(&windowWidth, &windowHeight);
// FIXME HACK. I don't like this at all, but macOS requires window size in LoDPI
#ifdef __APPLE__
uint scale;
getDpiScalingFactor(&scale);
windowWidth /= scale;
windowHeight /= scale;
#endif
_graphicsScale = MAX<int>(windowWidth / _lastRequestedWidth, windowHeight / _lastRequestedHeight);
_graphicsScale = MAX<int>(_graphicsScale + direction, 1);