diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-02 20:52:07 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-02 20:52:07 +0100 |
commit | 84df0c90cce062683ba87e0a06dcac6825ec326d (patch) | |
tree | 86f1b49a1629872a4dbc16d441cb7beeaa5a08a1 /editor | |
parent | a4a65a2a9fb89b705db15027963b34f2e6ea0a08 (diff) |
editor: add helper for showing fps on stdout
This is useful for debugging resolutions larger than the screen.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/imgui.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp index 62479aaa..ed2e1482 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -118,6 +118,15 @@ void app::draw_fps() ImDrawList& draw = *ImGui::GetForegroundDrawList(); draw.AddText(nullptr, ImGui::GetCurrentContext()->FontSize, {M->window_size()[0] - size.x - 3.5f*dpi[0], 3*dpi[1]}, ImGui::ColorConvertFloat4ToU32({0, 1, 0, 1}), buf); +#if 0 + static auto timer = fm_begin( Timeline t; t.start(); return t; ); + if (timer.currentFrameDuration() >= 2) + { + timer.start(); + std::printf("FPS %f\n", (double)(frame_time > 1e-6f ? 1/frame_time : 0)); + std::fflush(stdout); + } +#endif } void app::draw_tile_under_cursor() |