mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 11:57:00 +00:00
Metrics: Rebranded as "Dear ImGui Metrics/Debugger". Fix Show Window Rectangle. Fix Clang OSX warnings. Amend #3592 for Mingw only.
This commit is contained in:
parent
e736039538
commit
71cc636696
@ -71,6 +71,7 @@ Other Changes:
|
|||||||
It's essentially been always the case but it doesn't make much sense. Instead we will aim at exposing
|
It's essentially been always the case but it doesn't make much sense. Instead we will aim at exposing
|
||||||
feedback and control of keyboard/gamepad navigation highlight and mouse hover disable flag. (#787, #2048)
|
feedback and control of keyboard/gamepad navigation highlight and mouse hover disable flag. (#787, #2048)
|
||||||
- Metrics: Fixed mishandling of ImDrawCmd::VtxOffset in wireframe mesh renderer.
|
- Metrics: Fixed mishandling of ImDrawCmd::VtxOffset in wireframe mesh renderer.
|
||||||
|
- Metrics: Rebranded as "Dear ImGui Metrics/Debugger" to clarify its purpose.
|
||||||
- Misc: Made the ItemFlags stack shared, so effectively the ButtonRepeat/AllowKeyboardFocus states
|
- Misc: Made the ItemFlags stack shared, so effectively the ButtonRepeat/AllowKeyboardFocus states
|
||||||
(and others exposed in internals such as PushItemFlag) are inherited by stacked Begin/End pairs,
|
(and others exposed in internals such as PushItemFlag) are inherited by stacked Begin/End pairs,
|
||||||
vs previously a non-child stacked Begin() would reset those flags back to zero for the stacked window.
|
vs previously a non-child stacked Begin() would reset those flags back to zero for the stacked window.
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
// It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp.
|
// It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp.
|
||||||
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
|
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
|
||||||
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended.
|
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended.
|
||||||
//#define IMGUI_DISABLE_METRICS_WINDOW // Disable debug/metrics window: ShowMetricsWindow() will be empty.
|
//#define IMGUI_DISABLE_METRICS_WINDOW // Disable metrics/debugger window: ShowMetricsWindow() will be empty.
|
||||||
|
|
||||||
//---- Don't implement some functions to reduce linkage requirements.
|
//---- Don't implement some functions to reduce linkage requirements.
|
||||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
|
||||||
|
12
imgui.cpp
12
imgui.cpp
@ -4058,7 +4058,7 @@ static void AddWindowToSortBuffer(ImVector<ImGuiWindow*>* out_sorted_windows, Im
|
|||||||
static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* draw_list)
|
static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* draw_list)
|
||||||
{
|
{
|
||||||
// Remove trailing command if unused.
|
// Remove trailing command if unused.
|
||||||
// Technically we could return directly instead of popping, but this make things looks neat in Metrics window as well.
|
// Technically we could return directly instead of popping, but this make things looks neat in Metrics/Debugger window as well.
|
||||||
draw_list->_PopUnusedDrawCmd();
|
draw_list->_PopUnusedDrawCmd();
|
||||||
if (draw_list->CmdBuffer.Size == 0)
|
if (draw_list->CmdBuffer.Size == 0)
|
||||||
return;
|
return;
|
||||||
@ -4073,7 +4073,7 @@ static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* d
|
|||||||
// Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window)
|
// Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window)
|
||||||
// If this assert triggers because you are drawing lots of stuff manually:
|
// If this assert triggers because you are drawing lots of stuff manually:
|
||||||
// - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
|
// - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
|
||||||
// Be mindful that the ImDrawList API doesn't filter vertices. Use the Metrics window to inspect draw list contents.
|
// Be mindful that the ImDrawList API doesn't filter vertices. Use the Metrics/Debugger window to inspect draw list contents.
|
||||||
// - If you want large meshes with more than 64K vertices, you can either:
|
// - If you want large meshes with more than 64K vertices, you can either:
|
||||||
// (A) Handle the ImDrawCmd::VtxOffset value in your renderer backend, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
|
// (A) Handle the ImDrawCmd::VtxOffset value in your renderer backend, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
|
||||||
// Most example backends already support this from 1.71. Pre-1.71 backends won't.
|
// Most example backends already support this from 1.71. Pre-1.71 backends won't.
|
||||||
@ -10342,7 +10342,7 @@ static void MetricsHelpMarker(const char* desc)
|
|||||||
|
|
||||||
void ImGui::ShowMetricsWindow(bool* p_open)
|
void ImGui::ShowMetricsWindow(bool* p_open)
|
||||||
{
|
{
|
||||||
if (!Begin("Dear ImGui Metrics", p_open))
|
if (!Begin("Dear ImGui Metrics/Debugger", p_open))
|
||||||
{
|
{
|
||||||
End();
|
End();
|
||||||
return;
|
return;
|
||||||
@ -10370,7 +10370,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|||||||
if (cfg->ShowWindowsRectsType < 0)
|
if (cfg->ShowWindowsRectsType < 0)
|
||||||
cfg->ShowWindowsRectsType = WRT_WorkRect;
|
cfg->ShowWindowsRectsType = WRT_WorkRect;
|
||||||
if (cfg->ShowTablesRectsType < 0)
|
if (cfg->ShowTablesRectsType < 0)
|
||||||
cfg->ShowWindowsRectsType = TRT_WorkRect;
|
cfg->ShowTablesRectsType = TRT_WorkRect;
|
||||||
|
|
||||||
struct Funcs
|
struct Funcs
|
||||||
{
|
{
|
||||||
@ -10398,7 +10398,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|||||||
MetricsHelpMarker("Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash.");
|
MetricsHelpMarker("Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash.");
|
||||||
|
|
||||||
Checkbox("Show windows begin order", &cfg->ShowWindowsBeginOrder);
|
Checkbox("Show windows begin order", &cfg->ShowWindowsBeginOrder);
|
||||||
ImGui::Checkbox("Show windows rectangles", &cfg->ShowWindowsRects);
|
Checkbox("Show windows rectangles", &cfg->ShowWindowsRects);
|
||||||
SameLine();
|
SameLine();
|
||||||
SetNextItemWidth(GetFontSize() * 12);
|
SetNextItemWidth(GetFontSize() * 12);
|
||||||
cfg->ShowWindowsRects |= Combo("##show_windows_rect_type", &cfg->ShowWindowsRectsType, wrt_rects_names, WRT_Count, WRT_Count);
|
cfg->ShowWindowsRects |= Combo("##show_windows_rect_type", &cfg->ShowWindowsRectsType, wrt_rects_names, WRT_Count, WRT_Count);
|
||||||
@ -10595,7 +10595,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|||||||
}
|
}
|
||||||
#endif // #ifdef IMGUI_HAS_DOCK
|
#endif // #ifdef IMGUI_HAS_DOCK
|
||||||
|
|
||||||
ImGui::End();
|
End();
|
||||||
}
|
}
|
||||||
|
|
||||||
// [DEBUG] Display contents of Columns
|
// [DEBUG] Display contents of Columns
|
||||||
|
4
imgui.h
4
imgui.h
@ -88,7 +88,7 @@ Index of this file:
|
|||||||
#if !defined(IMGUI_USE_STB_SPRINTF) && defined(__clang__)
|
#if !defined(IMGUI_USE_STB_SPRINTF) && defined(__clang__)
|
||||||
#define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) // Apply printf-style warnings to our formatting functions.
|
#define IM_FMTARGS(FMT) __attribute__((format(printf, FMT, FMT+1))) // Apply printf-style warnings to our formatting functions.
|
||||||
#define IM_FMTLIST(FMT) __attribute__((format(printf, FMT, 0)))
|
#define IM_FMTLIST(FMT) __attribute__((format(printf, FMT, 0)))
|
||||||
#elif !defined(IMGUI_USE_STB_SPRINTF) && defined(__GNUC__)
|
#elif !defined(IMGUI_USE_STB_SPRINTF) && defined(__GNUC__) && defined(__MINGW32__)
|
||||||
#define IM_FMTARGS(FMT) __attribute__((format(gnu_printf, FMT, FMT+1))) // Apply printf-style warnings to our formatting functions.
|
#define IM_FMTARGS(FMT) __attribute__((format(gnu_printf, FMT, FMT+1))) // Apply printf-style warnings to our formatting functions.
|
||||||
#define IM_FMTLIST(FMT) __attribute__((format(gnu_printf, FMT, 0)))
|
#define IM_FMTLIST(FMT) __attribute__((format(gnu_printf, FMT, 0)))
|
||||||
#else
|
#else
|
||||||
@ -260,7 +260,7 @@ namespace ImGui
|
|||||||
// Demo, Debug, Information
|
// Demo, Debug, Information
|
||||||
IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create Demo window (previously called ShowTestWindow). demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
|
IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create Demo window (previously called ShowTestWindow). demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
|
||||||
IMGUI_API void ShowAboutWindow(bool* p_open = NULL); // create About window. display Dear ImGui version, credits and build/system information.
|
IMGUI_API void ShowAboutWindow(bool* p_open = NULL); // create About window. display Dear ImGui version, credits and build/system information.
|
||||||
IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create Debug/Metrics window. display Dear ImGui internals: draw commands (with individual draw calls and vertices), window list, basic internal state, etc.
|
IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.
|
||||||
IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)
|
IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)
|
||||||
IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles.
|
IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles.
|
||||||
IMGUI_API void ShowFontSelector(const char* label); // add font selector block (not a window), essentially a combo listing the loaded fonts.
|
IMGUI_API void ShowFontSelector(const char* label); // add font selector block (not a window), essentially a combo listing the loaded fonts.
|
||||||
|
@ -340,7 +340,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|||||||
}
|
}
|
||||||
if (ImGui::BeginMenu("Tools"))
|
if (ImGui::BeginMenu("Tools"))
|
||||||
{
|
{
|
||||||
ImGui::MenuItem("Metrics", NULL, &show_app_metrics);
|
ImGui::MenuItem("Metrics/Debugger", NULL, &show_app_metrics);
|
||||||
ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
|
ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
|
||||||
ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about);
|
ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about);
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
@ -357,7 +357,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|||||||
ImGui::BulletText("Sections below are demonstrating many aspects of the library.");
|
ImGui::BulletText("Sections below are demonstrating many aspects of the library.");
|
||||||
ImGui::BulletText("The \"Examples\" menu above leads to more demo contents.");
|
ImGui::BulletText("The \"Examples\" menu above leads to more demo contents.");
|
||||||
ImGui::BulletText("The \"Tools\" menu above gives access to: About Box, Style Editor,\n"
|
ImGui::BulletText("The \"Tools\" menu above gives access to: About Box, Style Editor,\n"
|
||||||
"and Metrics (general purpose Dear ImGui debugging tool).");
|
"and Metrics/Debugger (general purpose Dear ImGui debugging tool).");
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
ImGui::Text("PROGRAMMER GUIDE:");
|
ImGui::Text("PROGRAMMER GUIDE:");
|
||||||
|
@ -60,6 +60,9 @@ Index of this file:
|
|||||||
#if __has_warning("-Wunknown-warning-option")
|
#if __has_warning("-Wunknown-warning-option")
|
||||||
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' // not all warnings are known by all Clang versions and they tend to be rename-happy.. so ignoring warnings triggers new warnings on some configuration. Great!
|
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' // not all warnings are known by all Clang versions and they tend to be rename-happy.. so ignoring warnings triggers new warnings on some configuration. Great!
|
||||||
#endif
|
#endif
|
||||||
|
#if __has_warning("-Walloca")
|
||||||
|
#pragma clang diagnostic ignored "-Walloca" // warning: use of function '__builtin_alloca' is discouraged
|
||||||
|
#endif
|
||||||
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
|
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
|
||||||
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
|
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
|
||||||
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
|
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
|
||||||
|
@ -1639,7 +1639,7 @@ struct IMGUI_API ImGuiWindow
|
|||||||
ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack. (In theory this should be in the TempData structure)
|
ImVector<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack. (In theory this should be in the TempData structure)
|
||||||
ImGuiWindowTempData DC; // Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name.
|
ImGuiWindowTempData DC; // Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name.
|
||||||
|
|
||||||
// The best way to understand what those rectangles are is to use the 'Metrics -> Tools -> Show windows rectangles' viewer.
|
// The best way to understand what those rectangles are is to use the 'Metrics->Tools->Show Windows Rectangles' viewer.
|
||||||
// The main 'OuterRect', omitted as a field, is window->Rect().
|
// The main 'OuterRect', omitted as a field, is window->Rect().
|
||||||
ImRect OuterRectClipped; // == Window->Rect() just after setup in Begin(). == window->Rect() for root window.
|
ImRect OuterRectClipped; // == Window->Rect() just after setup in Begin(). == window->Rect() for root window.
|
||||||
ImRect InnerRect; // Inner rectangle (omit title bar, menu bar, scroll bar)
|
ImRect InnerRect; // Inner rectangle (omit title bar, menu bar, scroll bar)
|
||||||
|
Loading…
Reference in New Issue
Block a user