diff --git a/all.h b/all.h index ec07c39e9ce7fc0033cea79c4045b0d726f81b4b..59bdd32d4534bfd4ee4003cf082850bbd6721fbf 100644 --- a/all.h +++ b/all.h @@ -140,6 +140,7 @@ void UnloadMap(void); // Interface void DrawCrosshair(void); +void DrawDebugInfo(void); // Player void UpdatePlayer(void); diff --git a/game.c b/game.c index dc54ce51769459a43c92992ce3da81b1189e6943..67767d3b298c6629de9cb739acfff05a069b26b4 100644 --- a/game.c +++ b/game.c @@ -325,10 +325,7 @@ EndMode3D(); DrawCrosshair(); - - DrawTextEx(game.font_ui, TextFormat("%i FPS", GetFPS()), (Vector2){ 10, 10 }, 20, 2, GREEN); - DrawTextEx(game.font_ui, TextFormat("VSync: %s", game.vsync ? "ON" : "OFF"), (Vector2){ 10, 35 }, 20, 2, GREEN); - DrawTextEx(game.font_ui, TextFormat("Speed: %.0f", game.horizontal_speed), (Vector2){ 10, 60 }, 20, 2, GREEN); + DrawDebugInfo(); } EndDrawing(); diff --git a/interface.c b/interface.c index a376ed267b78a3ef6b8cdce35b5f541b895497ae..d2cb4e05df57cc06fafd7d14bd68e8579e442181 100644 --- a/interface.c +++ b/interface.c @@ -6,3 +6,9 @@ int screenHeight = GetScreenHeight(); DrawLine(screenWidth / 2 - 10, screenHeight / 2, screenWidth / 2 + 10, screenHeight / 2, GREEN); DrawLine(screenWidth / 2, screenHeight / 2 - 10, screenWidth / 2, screenHeight / 2 + 10, GREEN); } + +void DrawDebugInfo(void) { + DrawTextEx(game.font_ui, TextFormat("%i FPS", GetFPS()), (Vector2){ 10, 10 }, 20, 2, GREEN); + DrawTextEx(game.font_ui, TextFormat("VSync: %s", game.vsync ? "ON" : "OFF"), (Vector2){ 10, 35 }, 20, 2, GREEN); + DrawTextEx(game.font_ui, TextFormat("Speed: %.0f", game.horizontal_speed), (Vector2){ 10, 60 }, 20, 2, GREEN); +}