Skip to content

Commit 297dcc0

Browse files
committed
Update core_highdpi_testbed.c
1 parent 8cfb99f commit 297dcc0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/core/core_highdpi_testbed.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ int main(void)
4949
scaleDpi = GetWindowScaleDPI();
5050

5151
if (IsKeyPressed(KEY_SPACE)) ToggleBorderlessWindowed();
52+
if (IsKeyPressed(KEY_F)) ToggleFullscreen();
5253
//----------------------------------------------------------------------------------
5354

5455
// Draw
@@ -58,12 +59,12 @@ int main(void)
5859
ClearBackground(RAYWHITE);
5960

6061
// Draw grid
61-
for (int h = 0; h < 20; h++)
62+
for (int h = 0; h < GetScreenHeight()/gridSpacing + 1; h++)
6263
{
6364
DrawText(TextFormat("%02i", h*gridSpacing), 4, h*gridSpacing - 4, 10, GRAY);
6465
DrawLine(24, h*gridSpacing, GetScreenWidth(), h*gridSpacing, LIGHTGRAY);
6566
}
66-
for (int v = 0; v < 40; v++)
67+
for (int v = 0; v < GetScreenWidth()/gridSpacing + 1; v++)
6768
{
6869
DrawText(TextFormat("%02i", v*gridSpacing), v*gridSpacing - 10, 4, 10, GRAY);
6970
DrawLine(v*gridSpacing, 20, v*gridSpacing, GetScreenHeight(), LIGHTGRAY);
@@ -76,6 +77,10 @@ int main(void)
7677
DrawText(TextFormat("RENDER SIZE: %ix%i", GetRenderWidth(), GetRenderHeight()), 50, 130, 20, DARKGRAY);
7778
DrawText(TextFormat("SCALE FACTOR: %.1fx%.1f", scaleDpi.x, scaleDpi.y), 50, 170, 20, GRAY);
7879

80+
// Draw reference rectangles, top-left and bottom-right corners
81+
DrawRectangle(0, 0, 30, 60, RED);
82+
DrawRectangle(GetScreenWidth() - 30, GetScreenHeight() - 60, 30, 60, BLUE);
83+
7984
// Draw mouse position
8085
DrawCircleV(GetMousePosition(), 20, MAROON);
8186
DrawRectangle(mousePos.x - 25, mousePos.y, 50, 2, BLACK);

0 commit comments

Comments
 (0)