mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-10 21:48:46 +01:00
Update core_highdpi_testbed.c
This commit is contained in:
@ -49,6 +49,7 @@ int main(void)
|
||||
scaleDpi = GetWindowScaleDPI();
|
||||
|
||||
if (IsKeyPressed(KEY_SPACE)) ToggleBorderlessWindowed();
|
||||
if (IsKeyPressed(KEY_F)) ToggleFullscreen();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
// Draw
|
||||
@ -58,12 +59,12 @@ int main(void)
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
// Draw grid
|
||||
for (int h = 0; h < 20; h++)
|
||||
for (int h = 0; h < GetScreenHeight()/gridSpacing + 1; h++)
|
||||
{
|
||||
DrawText(TextFormat("%02i", h*gridSpacing), 4, h*gridSpacing - 4, 10, GRAY);
|
||||
DrawLine(24, h*gridSpacing, GetScreenWidth(), h*gridSpacing, LIGHTGRAY);
|
||||
}
|
||||
for (int v = 0; v < 40; v++)
|
||||
for (int v = 0; v < GetScreenWidth()/gridSpacing + 1; v++)
|
||||
{
|
||||
DrawText(TextFormat("%02i", v*gridSpacing), v*gridSpacing - 10, 4, 10, GRAY);
|
||||
DrawLine(v*gridSpacing, 20, v*gridSpacing, GetScreenHeight(), LIGHTGRAY);
|
||||
@ -76,6 +77,10 @@ int main(void)
|
||||
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);
|
||||
|
||||
// Draw reference rectangles, top-left and bottom-right corners
|
||||
DrawRectangle(0, 0, 30, 60, RED);
|
||||
DrawRectangle(GetScreenWidth() - 30, GetScreenHeight() - 60, 30, 60, BLUE);
|
||||
|
||||
// Draw mouse position
|
||||
DrawCircleV(GetMousePosition(), 20, MAROON);
|
||||
DrawRectangle(mousePos.x - 25, mousePos.y, 50, 2, BLACK);
|
||||
|
||||
Reference in New Issue
Block a user