diff --git a/app_render.cpp b/app_render.cpp index 5b436e7..80ba094 100644 --- a/app_render.cpp +++ b/app_render.cpp @@ -171,6 +171,7 @@ extern "C" void app_Render(App *app) { settextcolor(RGB(255, 255, 255)); + setbkcolor(RGB(0, 0, 0)); // If paused, display a text if (app->paused) @@ -181,6 +182,18 @@ extern "C" void app_Render(App *app) { render_DrawTextEx(buf, box2(SCREEN_WIDTH / 2.0 - 10, 50, 20, 100), DT_CENTER | DT_NOCLIP); } + // Display a Timer + if (strcmp(app->current_level, "title.txt") != 0) { + char buf[64]; + snprintf( + buf, sizeof(buf), + "%02d:%02d.%02d", + app->level_playtime.microseconds / 1000 / 1000 / 60, + app->level_playtime.microseconds / 1000 / 1000 % 60, + app->level_playtime.microseconds / 10000 % 100); + render_DrawTextEx(buf, box2(0, 0, SCREEN_WIDTH, TEXTHEIGHT), DT_RIGHT); + } + // Draw UI ui_Render(app->ui); } diff --git a/main.cpp b/main.cpp index 0825e63..3c1d334 100644 --- a/main.cpp +++ b/main.cpp @@ -63,6 +63,7 @@ int main() { app_Render(app); if (app->debugOn) { + setbkcolor(0); app_DebugText(app, debugText); render_DrawText(10, 10, (const char *)vector_Data(debugText)); }