From e42c1e1668640f923ad03be24f57eab794c13f1c Mon Sep 17 00:00:00 2001 From: omar Date: Sun, 8 Dec 2019 16:12:44 +0100 Subject: [PATCH] Exposed IMGUI_DEBUG_PARANOID in imconfig.h + using a #define with no value to match other uses in imconfig.h --- imconfig.h | 11 ++++++++--- imgui_internal.h | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/imconfig.h b/imconfig.h index 25cad5f5..39f24a02 100644 --- a/imconfig.h +++ b/imconfig.h @@ -77,14 +77,19 @@ //typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data); //#define ImDrawCallback MyImDrawCallback -//---- Debug Tools -// Use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging. +//---- Debug Tools: Macro to break in Debugger +// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.) //#define IM_DEBUG_BREAK IM_ASSERT(0) //#define IM_DEBUG_BREAK __debugbreak() -// Have the Item Picker break in the ItemAdd() function instead of ItemHoverable() - which is earlier in the code, will catch a few extra items, allow picking items other than Hovered one. + +//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(), +// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.) // This adds a small runtime cost which is why it is not enabled by default. //#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX +//---- Debug Tools: Enable slower asserts +//#define IMGUI_DEBUG_PARANOID + //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. /* namespace ImGui diff --git a/imgui_internal.h b/imgui_internal.h index 26cf3a15..013d5dca 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -156,8 +156,9 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer #endif // "Paranoid" Debug Asserts are meant to only be enabled during specific debugging/work, otherwise would slow down the code too much. -#define IMGUI_DEBUG_PARANOID 0 -#if IMGUI_DEBUG_PARANOID +// We currently don't have many of those so the effect is currently negligible, but onward intent to add more aggressive ones in the code. +//#define IMGUI_DEBUG_PARANOID +#ifdef IMGUI_DEBUG_PARANOID #define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR) #else #define IM_ASSERT_PARANOID(_EXPR)