Browse Source

Update core_highdpi_testbed.c

pull/5442/head
Ray 4 days ago
parent
commit
8871d7648d
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      examples/core/core_highdpi_testbed.c

+ 6
- 3
examples/core/core_highdpi_testbed.c View File

@ -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("RENDER SIZE: %ix%i", GetRenderWidth(), GetRenderHeight()), 50, 130, 20, DARKGRAY);
DrawText(TextFormat("SCALE FACTOR: %.1fx%.1f", scaleDpi.x, scaleDpi.y), 50, 170, 20, GRAY);
DrawText(TextFormat("WINDOW POSITION: %ix%i", windowPos.x, windowPos.y), 50, 90, 20, DARKGRAY);
DrawText(TextFormat("SCREEN SIZE: %ix%i", GetScreenWidth(), GetScreenHeight()), 50, 130, 20, DARKGRAY);
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);

Loading…
Cancel
Save