Skip to content

Commit a70973e

Browse files
committed
Bump imgui, tracy. Adopt implot.
1 parent 4406713 commit a70973e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+20080
-5385
lines changed

DebugGUI/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
2525
if(GLFW_FOUND)
2626
set(GUI_BACKEND
2727
src/imgui_impl_glfw_gl3.cpp
28+
src/implot.cpp
29+
src/implot_items.cpp
2830
src/gl3w.c
2931
src/Sokol3DUtils.cxx
3032
src/GL3DUtils.cxx
@@ -43,6 +45,8 @@ add_library(DebugGUI SHARED
4345
set(HEADERS
4446
src/imgui_extras.h
4547
src/imgui.h
48+
src/implot.h
49+
src/implot_internal.h
4650
src/imconfig.h
4751
src/Sokol3DUtils.h
4852
src/GL3DUtils.h
@@ -64,7 +68,7 @@ target_include_directories(DebugGUI
6468
if(GLFW_FOUND)
6569
target_link_libraries(DebugGUI PUBLIC glfw PRIVATE dl)
6670
add_executable(imgui_demo
67-
test/test_ImGUI.cpp test/imgui_demo.cpp
71+
test/test_ImGUI.cpp test/imgui_demo.cpp test/implot_demo.cpp
6872
)
6973
target_link_libraries(imgui_demo DebugGUI glfw)
7074
add_dependencies(imgui_demo DebugGUI)
@@ -77,6 +81,7 @@ if(GLFW_FOUND)
7781
test/test_DebugGUISokol.cxx
7882
)
7983
target_link_libraries(test_DebugGUISokol DebugGUI)
84+
8085
set(GLFW_TESTS imgui_demo test_DebugGUISokol test_DebugGUIGL)
8186
endif()
8287

DebugGUI/src/DebugGUI.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "imgui.h"
2+
#include "implot.h"
23
#include "imgui_impl_glfw_gl3.h"
34
#include "icons_font_awesome.h"
45
// Needed by icons_font_awesome.ttf.h
@@ -49,6 +50,7 @@ void* initGUI(const char* name, void(*error_callback)(int, char const*descriptio
4950
ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true; icons_config.FontDataOwnedByAtlas = false;
5051
io.Fonts->AddFontFromMemoryTTF((void*)s_iconsFontAwesomeTtf, sizeof(s_iconsFontAwesomeTtf), 12.0f, &icons_config, icons_ranges);
5152

53+
ImPlot::CreateContext();
5254
return window;
5355
}
5456

@@ -81,6 +83,7 @@ bool pollGUI(void* context, std::function<void(void)> guiCallback)
8183

8284
void disposeGUI()
8385
{
86+
ImPlot::DestroyContext();
8487
// Cleanup
8588
ImGui_ImplGlfwGL3_Shutdown();
8689
glfwTerminate();

DebugGUI/src/imconfig.h

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
44
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
55
//-----------------------------------------------------------------------------
6-
// A) You may edit imconfig.h (and not overwrite it when updating Dear 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 Dear ImGui. This is because some compile-time options have an affect on data structures.
6+
// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it)
7+
// B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template.
8+
//-----------------------------------------------------------------------------
9+
// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
10+
// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
1011
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
1112
// 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.
1213
//-----------------------------------------------------------------------------
1314

1415
#pragma once
1516

1617
//---- Define assertion handler. Defaults to calling assert().
18+
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
1719
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
1820
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
1921

@@ -22,13 +24,14 @@
2224
//#define IMGUI_API __declspec( dllexport )
2325
//#define IMGUI_API __declspec( dllimport )
2426

25-
//---- Don't define obsolete functions/enums names. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
27+
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
2628
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
2729

28-
//---- Don't implement demo windows functionality (ShowDemoWindow()/ShowStyleEditor()/ShowUserGuide() methods will be empty)
29-
// It is very strongly recommended to NOT disable the demo windows during development. Please read the comments in imgui_demo.cpp.
30-
//#define IMGUI_DISABLE_DEMO_WINDOWS
31-
//#define IMGUI_DISABLE_METRICS_WINDOW
30+
//---- Disable all of Dear ImGui or don't implement standard windows.
31+
// It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp.
32+
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
33+
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended.
34+
//#define IMGUI_DISABLE_METRICS_WINDOW // Disable debug/metrics window: ShowMetricsWindow() will be empty.
3235

3336
//---- Don't implement some functions to reduce linkage requirements.
3437
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc.
@@ -46,13 +49,20 @@
4649
//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
4750
//#define IMGUI_USE_BGRA_PACKED_COLOR
4851

52+
//---- Use 32-bit for ImWchar (default is 16-bit) to support full unicode code points.
53+
//#define IMGUI_USE_WCHAR32
54+
4955
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
5056
// By default the embedded implementations are declared static and not available outside of imgui cpp files.
5157
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
5258
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
5359
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
5460
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
5561

62+
//---- Unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined, use the much faster STB sprintf library implementation of vsnprintf instead of the one from the default C library.
63+
// Note that stb_sprintf.h is meant to be provided by the user and available in the include path at compile time. Also, the compatibility checks of the arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by STB sprintf.
64+
// #define IMGUI_USE_STB_SPRINTF
65+
5666
//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
5767
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
5868
/*
@@ -77,14 +87,19 @@
7787
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
7888
//#define ImDrawCallback MyImDrawCallback
7989

80-
//---- Debug Tools
81-
// Use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.
90+
//---- Debug Tools: Macro to break in Debugger
91+
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
8292
//#define IM_DEBUG_BREAK IM_ASSERT(0)
8393
//#define IM_DEBUG_BREAK __debugbreak()
84-
// 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.
94+
95+
//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(),
96+
// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.)
8597
// This adds a small runtime cost which is why it is not enabled by default.
8698
//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
8799

100+
//---- Debug Tools: Enable slower asserts
101+
//#define IMGUI_DEBUG_PARANOID
102+
88103
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
89104
/*
90105
namespace ImGui

0 commit comments

Comments
 (0)