Skip to content

Commit feae497

Browse files
committed
DPL: Port to ImGui 1.60
1 parent 036e2ff commit feae497

File tree

17 files changed

+15698
-5041
lines changed

17 files changed

+15698
-5041
lines changed

Framework/Core/src/FrameworkGUIDebugger.cxx

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -453,35 +453,34 @@ struct ChannelsTableHelper {
453453
void pushWindowColorDueToStatus(const DeviceInfo& info)
454454
{
455455
using LogLevel = LogParsingHelpers::LogLevel;
456-
457456
if (info.active == false) {
458-
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::DARK_RED);
459-
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::RED);
460-
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::RED);
461-
return;
462-
}
463-
switch (info.maxLogLevel) {
464-
case LogLevel::Error:
465-
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::SHADED_RED);
466-
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::RED);
467-
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::SHADED_RED);
468-
break;
469-
case LogLevel::Warning:
470-
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::SHADED_YELLOW);
471-
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::YELLOW);
472-
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::SHADED_YELLOW);
473-
break;
474-
case LogLevel::Info:
475-
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::SHADED_GREEN);
476-
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::GREEN);
477-
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::SHADED_GREEN);
478-
break;
479-
default:
480-
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::SHADED_BLUE);
481-
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::BLUE);
482-
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::SHADED_BLUE);
483-
break;
484-
}
457+
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::DARK_RED);
458+
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::RED);
459+
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::RED);
460+
return;
461+
}
462+
switch (info.maxLogLevel) {
463+
case LogLevel::Error:
464+
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::SHADED_RED);
465+
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::RED);
466+
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::SHADED_RED);
467+
break;
468+
case LogLevel::Warning:
469+
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::SHADED_YELLOW);
470+
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::YELLOW);
471+
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::SHADED_YELLOW);
472+
break;
473+
case LogLevel::Info:
474+
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::SHADED_GREEN);
475+
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::GREEN);
476+
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::SHADED_GREEN);
477+
break;
478+
default:
479+
ImGui::PushStyleColor(ImGuiCol_TitleBg, PaletteHelpers::SHADED_BLUE);
480+
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, PaletteHelpers::BLUE);
481+
ImGui::PushStyleColor(ImGuiCol_TitleBgCollapsed, PaletteHelpers::SHADED_BLUE);
482+
break;
483+
}
485484
}
486485

487486
void popWindowColorDueToStatus() { ImGui::PopStyleColor(3); }

Framework/Core/src/FrameworkGUIDevicesGraph.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void showTopologyNodeGraph(bool* opened,
172172
ImGui::Checkbox("Show grid", &show_grid);
173173
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(1,1));
174174
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0,0));
175-
ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, ImColor(60,60,70,200));
175+
ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, (ImU32) ImColor(60,60,70,200));
176176
ImGui::BeginChild("scrolling_region", ImVec2(0,0), true, ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoMove);
177177
ImGui::PushItemWidth(120.0f);
178178

Framework/DebugGUI/include/DebugGUI/imconfig.h

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,55 @@
11
//-----------------------------------------------------------------------------
2-
// USER IMPLEMENTATION
3-
// This file contains compile-time options for ImGui.
4-
// Other options (memory allocation overrides, callbacks, etc.) can be set at runtime via the ImGuiIO structure - ImGui::GetIO().
2+
// COMPILE-TIME OPTIONS FOR DEAR IMGUI
3+
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
4+
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
5+
//-----------------------------------------------------------------------------
6+
// A) You may edit imconfig.h (and not overwrite it when updating imgui, or maintain a patch/branch with your modifications to imconfig.h)
7+
// B) or add configuration directives in your own file and compile with #define IMGUI_USER_CONFIG "myfilename.h"
8+
// If you do so you need to make sure that configuration settings are defined consistently _everywhere_ dear imgui is used, which include
9+
// the imgui*.cpp files but also _any_ of your code that uses imgui. This is because some compile-time options have an affect on data structures.
10+
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
11+
// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using.
512
//-----------------------------------------------------------------------------
613

714
#pragma once
815

916
//---- Define assertion handler. Defaults to calling assert().
1017
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
18+
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
1119

1220
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows.
1321
//#define IMGUI_API __declspec( dllexport )
1422
//#define IMGUI_API __declspec( dllimport )
1523

16-
//---- Include imgui_user.h at the end of imgui.h
17-
//#define IMGUI_INCLUDE_IMGUI_USER_H
24+
//---- Don't define obsolete functions/enums names. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
25+
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
1826

19-
//---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions)
20-
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
21-
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS
27+
//---- Don't implement demo windows functionality (ShowDemoWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty)
28+
//---- It is very strongly recommended to NOT disable the demo windows during development. Please read the comments in imgui_demo.cpp.
29+
//#define IMGUI_DISABLE_DEMO_WINDOWS
2230

23-
//---- Don't implement help and test window functionality (ShowUserGuide()/ShowStyleEditor()/ShowTestWindow() methods will be empty)
24-
//#define IMGUI_DISABLE_TEST_WINDOWS
31+
//---- Don't implement some functions to reduce linkage requirements.
32+
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
33+
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow.
34+
//#define IMGUI_DISABLE_FORMAT_STRING_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself if you don't want to link with vsnprintf.
35+
//#define IMGUI_DISABLE_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 wrapper so you can implement them yourself. Declare your prototypes in imconfig.h.
36+
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free(). You will need to call ImGui::SetAllocatorFunctions().
2537

26-
//---- Don't define obsolete functions names
27-
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
38+
//---- Include imgui_user.h at the end of imgui.h as a convenience
39+
//#define IMGUI_INCLUDE_IMGUI_USER_H
2840

29-
//---- Pack colors to BGRA instead of RGBA (remove need to post process vertex buffer in back ends)
41+
//---- Pack colors to BGRA8 instead of RGBA8 (if you needed to convert from one to another anyway)
3042
//#define IMGUI_USE_BGRA_PACKED_COLOR
3143

32-
//---- Implement STB libraries in a namespace to avoid conflicts
33-
//#define IMGUI_STB_NAMESPACE ImGuiStb
44+
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
45+
// By default the embedded implementations are declared static and not available outside of imgui cpp files.
46+
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
47+
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
48+
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
49+
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
3450

3551
//---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
52+
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
3653
/*
3754
#define IM_VEC2_CLASS_EXTRA \
3855
ImVec2(const MyVec2& f) { x = f.x; y = f.y; } \
@@ -43,15 +60,13 @@
4360
operator MyVec4() const { return MyVec4(x,y,z,w); }
4461
*/
4562

46-
//---- Use 32-bit vertex indices (instead of default: 16-bit) to allow meshes with more than 64K vertices
63+
//---- Use 32-bit vertex indices (default is 16-bit) to allow meshes with more than 64K vertices. Render function needs to support it.
4764
//#define ImDrawIdx unsigned int
4865

4966
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
50-
//---- e.g. create variants of the ImGui::Value() helper for your low-level math types, or your own widgets/helpers.
5167
/*
5268
namespace ImGui
5369
{
54-
void Value(const char* prefix, const MyMatrix44& v, const char* float_format = NULL);
70+
void MyFunction(const char* name, const MyMatrix44& v);
5571
}
5672
*/
57-

0 commit comments

Comments
 (0)