diff options
author | quou <quou@disroot.org> | 2024-12-31 23:38:11 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-31 23:38:11 +1100 |
commit | 96b27fe9841e537614962e273ef9f0802365ea6d (patch) | |
tree | d1373862f700a83dd476555913b50c969159a836 /c2.cpp | |
parent | ae7824be86ecc53752a3bee1038c0677ac203cf7 (diff) |
ui stuf and things hmm m mmm m シ
Diffstat (limited to 'c2.cpp')
-rw-r--r-- | c2.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -9,6 +9,7 @@ extern "C" { } #include <string.h> #include <math.h> +#include <stdio.h> #define video_arena_size (1024 * 1024 * 16) #define asset_arena_size (1024 * 1024 * 4) @@ -138,6 +139,7 @@ extern "C" int entrypoint() { ui->layout(app->w, app->h); auto toolbar = ui->create_element<UI::Toolbar>(ui->root); register_debuggers(ui, toolbar); + auto fps_label = ui->create_element<UI::Label>(ui->root, ""); while (app->running) { Arena frame_arena; init_arena(&frame_arena, per_frame, per_frame_memory_size); @@ -145,6 +147,11 @@ extern "C" int entrypoint() { app->begin(); dev->begin_frame(); + if (frame % 10 == 0) { + char buf[32]; + sprintf(buf, "FPS: %g", 1.0f / app->dt); + fps_label->set_text(buf); + } ui->update(&frame_arena); { @@ -246,7 +253,7 @@ extern "C" int entrypoint() { ctx.debug_pop(); r += 10; - rot += 0.05f; + rot += 5.0f * app->dt; frame++; dev->present(); app->end(); |