|
3 | 3 | // Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure. |
4 | 4 | // You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions. |
5 | 5 | //----------------------------------------------------------------------------- |
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. |
10 | 11 | // Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts. |
11 | 12 | // 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. |
12 | 13 | //----------------------------------------------------------------------------- |
13 | 14 |
|
14 | 15 | #pragma once |
15 | 16 |
|
16 | 17 | //---- 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. |
17 | 19 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) |
18 | 20 | //#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts |
19 | 21 |
|
|
22 | 24 | //#define IMGUI_API __declspec( dllexport ) |
23 | 25 | //#define IMGUI_API __declspec( dllimport ) |
24 | 26 |
|
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. |
26 | 28 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS |
27 | 29 |
|
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. |
32 | 35 |
|
33 | 36 | //---- Don't implement some functions to reduce linkage requirements. |
34 | 37 | //#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 | 49 | //---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another) |
47 | 50 | //#define IMGUI_USE_BGRA_PACKED_COLOR |
48 | 51 |
|
| 52 | +//---- Use 32-bit for ImWchar (default is 16-bit) to support full unicode code points. |
| 53 | +//#define IMGUI_USE_WCHAR32 |
| 54 | + |
49 | 55 | //---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version |
50 | 56 | // By default the embedded implementations are declared static and not available outside of imgui cpp files. |
51 | 57 | //#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" |
52 | 58 | //#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" |
53 | 59 | //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION |
54 | 60 | //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION |
55 | 61 |
|
| 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 | + |
56 | 66 | //---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4. |
57 | 67 | // This will be inlined as part of ImVec2 and ImVec4 class declarations. |
58 | 68 | /* |
|
77 | 87 | //typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data); |
78 | 88 | //#define ImDrawCallback MyImDrawCallback |
79 | 89 |
|
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.) |
82 | 92 | //#define IM_DEBUG_BREAK IM_ASSERT(0) |
83 | 93 | //#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.) |
85 | 97 | // This adds a small runtime cost which is why it is not enabled by default. |
86 | 98 | //#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX |
87 | 99 |
|
| 100 | +//---- Debug Tools: Enable slower asserts |
| 101 | +//#define IMGUI_DEBUG_PARANOID |
| 102 | + |
88 | 103 | //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. |
89 | 104 | /* |
90 | 105 | namespace ImGui |
|
0 commit comments