Added console concept

This commit is contained in:
2026-09-15 02:36:23 -07:00
parent b16507c61d
commit a6b98e0613
4 changed files with 198 additions and 0 deletions
+10
View File
@@ -1,5 +1,6 @@
#include <sophia/ui/debug_ui.hpp>
#include "panels/console_panel.hpp"
#include "panels/frame_stats_panel.hpp"
#include "panels/panel_registry_panel.hpp"
@@ -9,17 +10,20 @@ DebugUI::DebugUI(PanelRegistry& registry) : registry{registry} {
// #ifndef NDEBUG
this->panelRegistryHandle = registry.emplace<PanelRegistryPanel>(registry);
this->frameStatsHandle = registry.emplace<FrameStatsPanel>();
this->consoleHandle = registry.emplace<ConsolePanel>();
// #endif // !NDEBUG
}
void DebugUI::show() {
showPanelRegistry(true);
showFrameStats(true);
showConsole(true);
}
void DebugUI::hide() {
showPanelRegistry(false);
showFrameStats(false);
showConsole(false);
}
void DebugUI::showPanelRegistry(bool show) {
@@ -34,4 +38,10 @@ void DebugUI::showFrameStats(bool show) {
}
}
void DebugUI::showConsole(bool show) {
if (registry.isValid(consoleHandle)) {
registry.get(consoleHandle).setVisible(show);
}
}
} // namespace sophia