diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-28 14:03:44 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-30 18:22:56 +0200 |
commit | a936a998fd6441679f123850bf4b62178ad4336e (patch) | |
tree | b7aa1e8642355aaf2e6ef412c24f1c0988a56a20 /editor | |
parent | b38454d56373125fc4715c509e5204c564f9e332 (diff) |
shaders/tuc: output stats every few seconds
Diffstat (limited to 'editor')
-rw-r--r-- | editor/draw.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/editor/draw.cpp b/editor/draw.cpp index f54d6b49..097a9deb 100644 --- a/editor/draw.cpp +++ b/editor/draw.cpp @@ -8,11 +8,14 @@ #include "src/camera-offset.hpp" #include "src/world.hpp" #include "character.hpp" + #include "rotation.inl" +#include "src/RTree-search.hpp" + +#include <chrono> #include <Magnum/Math/Color.h> #include <Magnum/Math/Vector3.h> #include <Magnum/GL/Renderer.h> -#include "src/RTree-search.hpp" namespace floormat { @@ -191,6 +194,19 @@ void app::draw() draw_cursor(); draw_ui(); render_menu(); + + using namespace std::chrono_literals; + { + constexpr auto print_every = 4s; + + static auto t0 = std::chrono::high_resolution_clock::now(); + auto t = std::chrono::high_resolution_clock::now(); + if (t - t0 >= print_every) + { + t0 = t; + M->texture_unit_cache().output_stats(); + } + } } clickable* app::find_clickable_scenery(const Optional<Vector2i>& pixel) |