Skip to content

Commit ec549c4

Browse files
committed
Update ImGui to 1.90.4 + docking.
1 parent ea0471f commit ec549c4

File tree

8 files changed

+929
-480
lines changed

8 files changed

+929
-480
lines changed

imgui/imgui.cpp

Lines changed: 536 additions & 260 deletions
Large diffs are not rendered by default.

imgui/imgui.h

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.90.1
1+
// dear imgui, v1.90.4
22
// (headers)
33

44
// Help:
@@ -23,8 +23,8 @@
2323

2424
// Library Version
2525
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
26-
#define IMGUI_VERSION "1.90.1"
27-
#define IMGUI_VERSION_NUM 19010
26+
#define IMGUI_VERSION "1.90.4"
27+
#define IMGUI_VERSION_NUM 19040
2828
#define IMGUI_HAS_TABLE
2929
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
3030
#define IMGUI_HAS_DOCK // Docking WIP branch
@@ -91,6 +91,8 @@ Index of this file:
9191
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
9292

9393
// Helper Macros - IM_FMTARGS, IM_FMTLIST: Apply printf-style warnings to our formatting functions.
94+
// (MSVC provides an equivalent mechanism via SAL Annotations but it would require the macros in a different
95+
// location. e.g. #include <sal.h> + void myprintf(_Printf_format_string_ const char* format, ...))
9496
#if !defined(IMGUI_USE_STB_SPRINTF) && defined(__MINGW32__) && !defined(__clang__)
9597
#define IM_FMTARGS(FMT) __attribute__((format(gnu_printf, FMT, FMT+1)))
9698
#define IM_FMTLIST(FMT) __attribute__((format(gnu_printf, FMT, 0)))
@@ -348,7 +350,7 @@ namespace ImGui
348350
// - Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child.
349351
// - Before 1.90 (November 2023), the "ImGuiChildFlags child_flags = 0" parameter was "bool border = false".
350352
// This API is backward compatible with old code, as we guarantee that ImGuiChildFlags_Border == true.
351-
// Consider updating your old call sites:
353+
// Consider updating your old code:
352354
// BeginChild("Name", size, false) -> Begin("Name", size, 0); or Begin("Name", size, ImGuiChildFlags_None);
353355
// BeginChild("Name", size, true) -> Begin("Name", size, ImGuiChildFlags_Border);
354356
// - Manual sizing (each axis can use a different setting e.g. ImVec2(0.0f, 400.0f)):
@@ -452,7 +454,7 @@ namespace ImGui
452454
IMGUI_API ImVec2 GetFontTexUvWhitePixel(); // get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API
453455
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul = 1.0f); // retrieve given style color with style alpha applied and optional extra alpha multiplier, packed as a 32-bit value suitable for ImDrawList
454456
IMGUI_API ImU32 GetColorU32(const ImVec4& col); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
455-
IMGUI_API ImU32 GetColorU32(ImU32 col); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
457+
IMGUI_API ImU32 GetColorU32(ImU32 col, float alpha_mul = 1.0f); // retrieve given color with style alpha applied, packed as a 32-bit value suitable for ImDrawList
456458
IMGUI_API const ImVec4& GetStyleColorVec4(ImGuiCol idx); // retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwise use GetColorU32() to get style color with style alpha baked in.
457459

458460
// Layout cursor positioning
@@ -996,6 +998,7 @@ namespace ImGui
996998
// - Your main debugging friend is the ShowMetricsWindow() function, which is also accessible from Demo->Tools->Metrics Debugger
997999
IMGUI_API void DebugTextEncoding(const char* text);
9981000
IMGUI_API void DebugFlashStyleColor(ImGuiCol idx);
1001+
IMGUI_API void DebugStartItemPicker();
9991002
IMGUI_API bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx); // This is called by IMGUI_CHECKVERSION() macro.
10001003

10011004
// Memory Allocators
@@ -1068,7 +1071,7 @@ enum ImGuiWindowFlags_
10681071
};
10691072

10701073
// Flags for ImGui::BeginChild()
1071-
// (Legacy: bot 0 must always correspond to ImGuiChildFlags_Border to be backward compatible with old API using 'bool border = false'.
1074+
// (Legacy: bit 0 must always correspond to ImGuiChildFlags_Border to be backward compatible with old API using 'bool border = false'.
10721075
// About using AutoResizeX/AutoResizeY flags:
10731076
// - May be combined with SetNextWindowSizeConstraints() to set a min/max size for each axis (see "Demo->Child->Auto-resize with Constraints").
10741077
// - Size measurement for a given axis is only performed when the child window is within visible boundaries, or is just appearing.
@@ -1079,7 +1082,7 @@ enum ImGuiWindowFlags_
10791082
enum ImGuiChildFlags_
10801083
{
10811084
ImGuiChildFlags_None = 0,
1082-
ImGuiChildFlags_Border = 1 << 0, // Show an outer border and enable WindowPadding. (Important: this is always == 1 == true for legacy reason)
1085+
ImGuiChildFlags_Border = 1 << 0, // Show an outer border and enable WindowPadding. (IMPORTANT: this is always == 1 == true for legacy reason)
10831086
ImGuiChildFlags_AlwaysUseWindowPadding = 1 << 1, // Pad with style.WindowPadding even if no border are drawn (no padding by default for non-bordered child windows because it makes more sense)
10841087
ImGuiChildFlags_ResizeX = 1 << 2, // Allow resize from right border (layout direction). Enable .ini saving (unless ImGuiWindowFlags_NoSavedSettings passed to window flags)
10851088
ImGuiChildFlags_ResizeY = 1 << 3, // Allow resize from bottom border (layout direction). "
@@ -1148,8 +1151,8 @@ enum ImGuiTreeNodeFlags_
11481151
};
11491152

11501153
// Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.
1151-
// - To be backward compatible with older API which took an 'int mouse_button = 1' argument, we need to treat
1152-
// small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags.
1154+
// - To be backward compatible with older API which took an 'int mouse_button = 1' argument instead of 'ImGuiPopupFlags flags',
1155+
// we need to treat small flags values as a mouse button index, so we encode the mouse button in the first few bits of the flags.
11531156
// It is therefore guaranteed to be legal to pass a mouse button index in ImGuiPopupFlags.
11541157
// - For the same reason, we exceptionally default the ImGuiPopupFlags argument of BeginPopupContextXXX functions to 1 instead of 0.
11551158
// IMPORTANT: because the default parameter is 1 (==ImGuiPopupFlags_MouseButtonRight), if you rely on the default parameter
@@ -1163,10 +1166,12 @@ enum ImGuiPopupFlags_
11631166
ImGuiPopupFlags_MouseButtonMiddle = 2, // For BeginPopupContext*(): open on Middle Mouse release. Guaranteed to always be == 2 (same as ImGuiMouseButton_Middle)
11641167
ImGuiPopupFlags_MouseButtonMask_ = 0x1F,
11651168
ImGuiPopupFlags_MouseButtonDefault_ = 1,
1166-
ImGuiPopupFlags_NoOpenOverExistingPopup = 1 << 5, // For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack
1167-
ImGuiPopupFlags_NoOpenOverItems = 1 << 6, // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space
1168-
ImGuiPopupFlags_AnyPopupId = 1 << 7, // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
1169-
ImGuiPopupFlags_AnyPopupLevel = 1 << 8, // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level)
1169+
ImGuiPopupFlags_NoReopen = 1 << 5, // For OpenPopup*(), BeginPopupContext*(): don't reopen same popup if already open (won't reposition, won't reinitialize navigation)
1170+
//ImGuiPopupFlags_NoReopenAlwaysNavInit = 1 << 6, // For OpenPopup*(), BeginPopupContext*(): focus and initialize navigation even when not reopening.
1171+
ImGuiPopupFlags_NoOpenOverExistingPopup = 1 << 7, // For OpenPopup*(), BeginPopupContext*(): don't open if there's already a popup at the same level of the popup stack
1172+
ImGuiPopupFlags_NoOpenOverItems = 1 << 8, // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space
1173+
ImGuiPopupFlags_AnyPopupId = 1 << 10, // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
1174+
ImGuiPopupFlags_AnyPopupLevel = 1 << 11, // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level)
11701175
ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel,
11711176
};
11721177

@@ -2282,11 +2287,7 @@ struct ImGuiIO
22822287
int KeyMap[ImGuiKey_COUNT]; // [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512.
22832288
bool KeysDown[ImGuiKey_COUNT]; // [LEGACY] Input: Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow.
22842289
float NavInputs[ImGuiNavInput_COUNT]; // [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
2285-
#endif
2286-
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
2287-
void* ImeWindowHandle; // = NULL // [Obsoleted in 1.87] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.
2288-
#else
2289-
void* _UnusedPadding;
2290+
//void* ImeWindowHandle; // [Obsoleted in 1.87] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.
22902291
#endif
22912292

22922293
//------------------------------------------------------------------
@@ -2403,6 +2404,7 @@ struct ImGuiWindowClass
24032404
{
24042405
ImGuiID ClassId; // User data. 0 = Default class (unclassed). Windows of different classes cannot be docked with each others.
24052406
ImGuiID ParentViewportId; // Hint for the platform backend. -1: use default. 0: request platform backend to not parent the platform. != 0: request platform backend to create a parent<>child relationship between the platform windows. Not conforming backends are free to e.g. parent every viewport to the main viewport or not.
2407+
ImGuiID FocusRouteParentWindowId; // ID of parent window for shortcut focus route evaluation, e.g. Shortcut() call from Parent Window will succeed when this window is focused.
24062408
ImGuiViewportFlags ViewportFlagsOverrideSet; // Viewport flags to set when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
24072409
ImGuiViewportFlags ViewportFlagsOverrideClear; // Viewport flags to clear when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
24082410
ImGuiTabItemFlags TabItemFlagsOverrideSet; // [EXPERIMENTAL] TabItem flags to set when a window of this class gets submitted into a dock node tab bar. May use with ImGuiTabItemFlags_Leading or ImGuiTabItemFlags_Trailing.
@@ -2883,7 +2885,8 @@ struct ImDrawList
28832885
IMGUI_API void AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawFlags flags = 0);
28842886

28852887
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
2886-
// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
2888+
// - Important: filled shapes must always use clockwise winding order! The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
2889+
// so e.g. 'PathArcTo(center, radius, PI * -0.5f, PI)' is ok, whereas 'PathArcTo(center, radius, PI, PI * -0.5f)' won't have correct anti-aliasing when followed by PathFillConvex().
28872890
inline void PathClear() { _Path.Size = 0; }
28882891
inline void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); }
28892892
inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path.Data[_Path.Size - 1], &pos, 8) != 0) _Path.push_back(pos); }

0 commit comments

Comments
 (0)