Explorar el Código

Update core_highdpi_testbed.c

pull/5442/head
Ray hace 2 días
padre
commit
297dcc07b8
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. +7
    -2
      examples/core/core_highdpi_testbed.c

+ 7
- 2
examples/core/core_highdpi_testbed.c Ver fichero

@ -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 < mi">20; h++)
for (int h = 0; h < n">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 < mi">40; v++)
for (int v = 0; v < n">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);

Cargando…
Cancelar
Guardar