Added console concept
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user