REVIEWED: GetRender*() issue on macOS highDPI #3367

This commit is contained in:
Ray 2023-10-30 13:13:31 +01:00
parent 15632876f7
commit 9642fffbbb

View File

@ -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