#include #include "panels/console_panel.hpp" #include "panels/frame_stats_panel.hpp" #include "panels/panel_registry_panel.hpp" namespace sophia { DebugUI::DebugUI(PanelRegistry& registry, ConsoleCommandRegistry& commands) : registry{registry} { // #ifndef NDEBUG this->panelRegistryHandle = registry.emplace(registry); this->frameStatsHandle = registry.emplace(); this->consoleHandle = registry.emplace(commands); // #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) { if (registry.isValid(panelRegistryHandle)) { registry.get(panelRegistryHandle).setVisible(show); } } void DebugUI::showFrameStats(bool show) { if (registry.isValid(frameStatsHandle)) { registry.get(frameStatsHandle).setVisible(show); } } void DebugUI::showConsole(bool show) { if (registry.isValid(consoleHandle)) { registry.get(consoleHandle).setVisible(show); } } } // namespace sophia