From a0b30b0363cfbadb359db87ffd8fa80748485980 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 9 Oct 2023 01:02:19 +0200 Subject: [PATCH] REVIEWED: `SetupViewport()` macOS #3313 --- src/rcore.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 85a84f59..3a8820e3 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2162,9 +2162,10 @@ void SetupViewport(int width, int 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__) - float xScale = 1.0f, yScale = 1.0f; - glfwGetWindowContentScale(CORE.Window.handle, &xScale, &yScale); - rlViewport(CORE.Window.renderOffset.x/2*xScale, CORE.Window.renderOffset.y/2*yScale, (CORE.Window.render.width)*xScale, (CORE.Window.render.height)*yScale); + //float xScale = 1.0f, yScale = 1.0f; + //glfwGetWindowContentScale(CORE.Window.handle, &xScale, &yScale); + 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