From 79e46a1017d4d75ba4d5c2c00a07e592328af8f0 Mon Sep 17 00:00:00 2001 From: alexei-zebra Date: Tue, 23 Dec 2025 18:04:04 +0300 Subject: [PATCH] update: debug panel: smooth min/max fps --- src/frontend/debug_panel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/debug_panel.cpp b/src/frontend/debug_panel.cpp index b569170bf..80f4904ee 100644 --- a/src/frontend/debug_panel.cpp +++ b/src/frontend/debug_panel.cpp @@ -69,7 +69,9 @@ std::shared_ptr create_debug_panel( static int fps = 0; static int fpsMin = fps; + static int fpsMinOld = fpsMin; static int fpsMax = fps; + static int fpsMaxOld = fpsMax; static float fpsAvgFast = fps; static float fpsAvgLong = fps; static float fpsAvgAlpha = 0.1; @@ -89,7 +91,9 @@ std::shared_ptr create_debug_panel( }); panel->listenInterval(2.0f, []() { + fpsMinOld = fpsMin; fpsMin = fps; + fpsMaxOld = fpsMax; fpsMax = fps; }); @@ -108,7 +112,7 @@ std::shared_ptr create_debug_panel( panel->add(create_label(gui, []() { return L"fps: " + std::to_wstring(int(fpsAvgFast)) + L" / " + std::to_wstring(int(fpsAvgLong)) + L" / " + - std::to_wstring(fpsMin) + L" / " + std::to_wstring(fpsMax); + std::to_wstring(std::min(fpsMinOld, fpsMin)) + L" / " + std::to_wstring(std::max(fpsMaxOld, fpsMax)); })); panel->add(create_label(gui, []() { return L"meshes: " + std::to_wstring(MeshStats::meshesCount);