changes for ImGui

This commit is contained in:
2026-09-15 02:23:22 -07:00
parent 12a1e6eca9
commit 05fe3c2ee8
14 changed files with 593 additions and 6 deletions
+37
View File
@@ -0,0 +1,37 @@
#include <sophia/ui/debug_ui.hpp>
#include "panels/frame_stats_panel.hpp"
#include "panels/panel_registry_panel.hpp"
namespace sophia {
DebugUI::DebugUI(PanelRegistry& registry) : registry{registry} {
// #ifndef NDEBUG
this->panelRegistryHandle = registry.emplace<PanelRegistryPanel>(registry);
this->frameStatsHandle = registry.emplace<FrameStatsPanel>();
// #endif // !NDEBUG
}
void DebugUI::show() {
showPanelRegistry(true);
showFrameStats(true);
}
void DebugUI::hide() {
showPanelRegistry(false);
showFrameStats(false);
}
void DebugUI::showPanelRegistry(bool show) {
if (registry.isValid(panelRegistryHandle)) {
registry.get(panelRegistryHandle).setVisible(show);
}
}
void DebugUI::showFrameStats(bool show) {
if (registry.isValid(frameStatsHandle)) {
registry.get(frameStatsHandle).setVisible(show);
}
}
} // namespace sophia