REVIEWED: Window scaling with HighDPI on macOS #5059

This commit is contained in:
Ray
2025-12-17 21:23:25 +01:00
parent 6d562e5e87
commit 4b760091da
3 changed files with 14 additions and 21 deletions

View File

@@ -3815,14 +3815,7 @@ void SetupViewport(int width, int height)
CORE.Window.render.height = height;
// Set viewport width and height
// NOTE: We consider render size (scaled) and offset in case black bars are required and
// render area does not match full display area (this situation is only applicable on fullscreen mode)
#if defined(__APPLE__)
Vector2 scale = GetWindowScaleDPI();
rlViewport(CORE.Window.renderOffset.x/2*scale.x, CORE.Window.renderOffset.y/2*scale.y, (CORE.Window.render.width)*scale.x, (CORE.Window.render.height)*scale.y);
#else
rlViewport(CORE.Window.renderOffset.x/2, CORE.Window.renderOffset.y/2, CORE.Window.render.width, CORE.Window.render.height);
#endif
rlMatrixMode(RL_PROJECTION); // Switch to projection matrix
rlLoadIdentity(); // Reset current matrix (projection)