mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-11 14:08:48 +01:00
Update core_highdpi_testbed.c
This commit is contained in:
@ -33,6 +33,7 @@ int main(void)
|
|||||||
Vector2 scaleDpi = GetWindowScaleDPI();
|
Vector2 scaleDpi = GetWindowScaleDPI();
|
||||||
Vector2 mousePos = GetMousePosition();
|
Vector2 mousePos = GetMousePosition();
|
||||||
int currentMonitor = GetCurrentMonitor();
|
int currentMonitor = GetCurrentMonitor();
|
||||||
|
Vector2 windowPos = GetWindowPosition();
|
||||||
|
|
||||||
int gridSpacing = 40; // Grid spacing in pixels
|
int gridSpacing = 40; // Grid spacing in pixels
|
||||||
|
|
||||||
@ -47,6 +48,7 @@ int main(void)
|
|||||||
mousePos = GetMousePosition();
|
mousePos = GetMousePosition();
|
||||||
currentMonitor = GetCurrentMonitor();
|
currentMonitor = GetCurrentMonitor();
|
||||||
scaleDpi = GetWindowScaleDPI();
|
scaleDpi = GetWindowScaleDPI();
|
||||||
|
windowPos = GetWindowPosition();
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_SPACE)) ToggleBorderlessWindowed();
|
if (IsKeyPressed(KEY_SPACE)) ToggleBorderlessWindowed();
|
||||||
if (IsKeyPressed(KEY_F)) ToggleFullscreen();
|
if (IsKeyPressed(KEY_F)) ToggleFullscreen();
|
||||||
@ -73,9 +75,10 @@ int main(void)
|
|||||||
// Draw UI info
|
// Draw UI info
|
||||||
DrawText(TextFormat("CURRENT MONITOR: %i/%i (%ix%i)", currentMonitor + 1, GetMonitorCount(),
|
DrawText(TextFormat("CURRENT MONITOR: %i/%i (%ix%i)", currentMonitor + 1, GetMonitorCount(),
|
||||||
GetMonitorWidth(currentMonitor), GetMonitorHeight(currentMonitor)), 50, 50, 20, DARKGRAY);
|
GetMonitorWidth(currentMonitor), GetMonitorHeight(currentMonitor)), 50, 50, 20, DARKGRAY);
|
||||||
DrawText(TextFormat("SCREEN SIZE: %ix%i", GetScreenWidth(), GetScreenHeight()), 50, 90, 20, DARKGRAY);
|
DrawText(TextFormat("WINDOW POSITION: %ix%i", windowPos.x, windowPos.y), 50, 90, 20, DARKGRAY);
|
||||||
DrawText(TextFormat("RENDER SIZE: %ix%i", GetRenderWidth(), GetRenderHeight()), 50, 130, 20, DARKGRAY);
|
DrawText(TextFormat("SCREEN SIZE: %ix%i", GetScreenWidth(), GetScreenHeight()), 50, 130, 20, DARKGRAY);
|
||||||
DrawText(TextFormat("SCALE FACTOR: %.1fx%.1f", scaleDpi.x, scaleDpi.y), 50, 170, 20, GRAY);
|
DrawText(TextFormat("RENDER SIZE: %ix%i", GetRenderWidth(), GetRenderHeight()), 50, 170, 20, DARKGRAY);
|
||||||
|
DrawText(TextFormat("SCALE FACTOR: %.1fx%.1f", scaleDpi.x, scaleDpi.y), 50, 210, 20, GRAY);
|
||||||
|
|
||||||
// Draw reference rectangles, top-left and bottom-right corners
|
// Draw reference rectangles, top-left and bottom-right corners
|
||||||
DrawRectangle(0, 0, 30, 60, RED);
|
DrawRectangle(0, 0, 30, 60, RED);
|
||||||
|
|||||||
Reference in New Issue
Block a user