From f18b844261ff65ac3d67b6f307d14d5c6698bfcc Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 11 Sep 2023 16:36:16 +0200 Subject: [PATCH] Configuration flags --- Debug-Tools.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Debug-Tools.md b/Debug-Tools.md index c6642eb..16d9a76 100644 --- a/Debug-Tools.md +++ b/Debug-Tools.md @@ -1,5 +1,26 @@ (work in progress) Also see [[Tips]]. +### Debug Configuration Flags + +Runtime flags available in `ImGuiIO` (and exposed in Demo->Configuration): +```cpp +// Tools to test correct Begin/End and BeginChild/EndChild behaviors. +// Presently Begin()/End() and BeginChild()/EndChild() needs to ALWAYS be called in tandem, regardless of return value of BeginXXX() +// This is inconsistent with other BeginXXX functions and create confusion for many users. +// We expect to update the API eventually. In the meanwhile we provide tools to facilitate checking user-code behavior. +bool ConfigDebugBeginReturnValueOnce; // First-time calls to Begin()/BeginChild() will return false. NEEDS TO BE SET AT APPLICATION BOOT TIME if you don't want to miss windows. +bool ConfigDebugBeginReturnValueLoop; // Some calls to Begin()/BeginChild() will return false. Will cycle through window depths then repeat. Suggested use: add "io.ConfigDebugBeginReturnValue = io.KeyShift" in your main loop then occasionally press SHIFT. Windows should be flickering while running. + +// Option to deactivate io.AddFocusEvent(false) handling. May facilitate interactions with a debugger when focus loss leads to clearing inputs data. +// Backends may have other side-effects on focus loss, so this will reduce side-effects but not necessary remove all of them. +// Consider using e.g. Win32's IsDebuggerPresent() as an additional filter (or see ImOsIsDebuggerPresent() in imgui_test_engine/imgui_te_utils.cpp for a Unix compatible version). +bool ConfigDebugIgnoreFocusLoss; // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys() in input processing. + +// Options to audit .ini data +bool ConfigDebugIniSettings; // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower) +``` + + ### Metrics/Debugger window Many internal state and tools are exposed in the Metrics window. To access the Metrics window: