summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-30 13:13:31 +0100
committerRay <[email protected]>2023-10-30 13:13:31 +0100
commit9642fffbbbdda0d31bedae6126e7b3b9073ec407 (patch)
tree9749964178a5348c40c9740837c774e751e71a51 /src
parent15632876f7d27857888d5eeab5caf0e322a5b791 (diff)
downloadraylib-9642fffbbbdda0d31bedae6126e7b3b9073ec407.tar.gz
raylib-9642fffbbbdda0d31bedae6126e7b3b9073ec407.zip
REVIEWED: `GetRender*()` issue on macOS highDPI #3367
Diffstat (limited to 'src')
-rw-r--r--src/rcore.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/rcore.c b/src/rcore.c
index 902f84c6..415fecfd 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -748,13 +748,27 @@ int GetScreenHeight(void)
// Get current render width which is equal to screen width*dpi scale
int GetRenderWidth(void)
{
- return CORE.Window.render.width;
+ int width = 0;
+#if defined(__APPLE__)
+ Vector2 scale = GetWindowScaleDPI();
+ width = (int)((float)CORE.Window.render.width*scale.x);
+#else
+ width = CORE.Window.render.width;
+#endif
+ return width;
}
// Get current screen height which is equal to screen height*dpi scale
int GetRenderHeight(void)
{
- return CORE.Window.render.height;
+ int height = 0;
+#if defined(__APPLE__)
+ Vector2 scale = GetWindowScaleDPI();
+ height = (int)((float)CORE.Window.render.width*scale.y);
+#else
+ height = CORE.Window.render.height;
+#endif
+ return height;
}
// Enable waiting for events on EndDrawing(), no automatic event polling