mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-20 05:15:37 +00:00
REVIEWED: Window scaling with HighDPI on macOS #5059
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user