From bde0f2c7c3f1fbe03a1c45c72337bd9c39a41bab Mon Sep 17 00:00:00 2001 From: Green Sky Date: Fri, 15 Mar 2024 13:01:14 +0100 Subject: [PATCH] imgui debug stuff --- src/main_screen.cpp | 29 ++++++++++++++++++++++++++++- src/main_screen.hpp | 3 +++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/main_screen.cpp b/src/main_screen.cpp index dfa6240d..e84a2c91 100644 --- a/src/main_screen.cpp +++ b/src/main_screen.cpp @@ -215,9 +215,24 @@ Screen* MainScreen::render(float time_delta, bool&) { ImGui::EndMenu(); } if (ImGui::BeginMenu("Settings")) { - if (ImGui::MenuItem("ImGui Style Editor")) { + ImGui::SeparatorText("ImGui"); + + if (ImGui::MenuItem("Style Editor")) { _show_tool_style_editor = true; } + + if (ImGui::MenuItem("Metrics")) { + _show_tool_metrics = true; + } + + if (ImGui::MenuItem("Debug Log")) { + _show_tool_debug_log = true; + } + + if (ImGui::MenuItem("ID Stack Tool")) { + _show_tool_id_stack = true; + } + ImGui::EndMenu(); } ImGui::EndMenuBar(); @@ -234,6 +249,18 @@ Screen* MainScreen::render(float time_delta, bool&) { ImGui::End(); } + if (_show_tool_metrics) { + ImGui::ShowMetricsWindow(&_show_tool_metrics); + } + + if (_show_tool_debug_log) { + ImGui::ShowDebugLogWindow(&_show_tool_debug_log); + } + + if (_show_tool_id_stack) { + ImGui::ShowIDStackToolWindow(&_show_tool_id_stack); + } + if constexpr (false) { ImGui::ShowDemoWindow(); } diff --git a/src/main_screen.hpp b/src/main_screen.hpp index 47164a8e..301d6956 100644 --- a/src/main_screen.hpp +++ b/src/main_screen.hpp @@ -76,6 +76,9 @@ struct MainScreen final : public Screen { ToxDHTCapHisto tdch; bool _show_tool_style_editor {false}; + bool _show_tool_metrics {false}; + bool _show_tool_debug_log {false}; + bool _show_tool_id_stack {false}; bool _window_hidden {false}; uint64_t _window_hidden_ts {0};