Skip to content

Commit

Permalink
Merge branch 'master' into docking
Browse files Browse the repository at this point in the history
# Conflicts:
#	backends/imgui_impl_metal.mm
#	imgui_draw.cpp
  • Loading branch information
ocornut committed Nov 7, 2024
2 parents d9f829d + f401021 commit 368123a
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 64 deletions.
9 changes: 1 addition & 8 deletions backends/imgui_impl_metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@
#import <time.h>
#import <Metal/Metal.h>

#if defined(__clang__)
#if __has_warning("-Wunknown-warning-option")
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx'
#endif
#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
#endif

// Forward Declarations
static void ImGui_ImplMetal_InitMultiViewportSupport();
static void ImGui_ImplMetal_ShutdownMultiViewportSupport();
Expand Down Expand Up @@ -91,7 +84,7 @@ - (MetalBuffer*)dequeueReusableBufferOfLength:(NSUInteger)length device:(id<MTLD
{
MetalContext* SharedMetalContext;

ImGui_ImplMetal_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplMetal_Data() { memset((void*)this, 0, sizeof(*this)); }
};

static ImGui_ImplMetal_Data* ImGui_ImplMetal_GetBackendData() { return ImGui::GetCurrentContext() ? (ImGui_ImplMetal_Data*)ImGui::GetIO().BackendRendererUserData : nullptr; }
Expand Down
9 changes: 1 addition & 8 deletions backends/imgui_impl_osx.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@
#import <GameController/GameController.h>
#import <time.h>

#if defined(__clang__)
#if __has_warning("-Wunknown-warning-option")
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx'
#endif
#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
#endif

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2024-XX-XX: Added support for multiple windows via the ImGuiPlatformIO interface.
Expand Down Expand Up @@ -99,7 +92,7 @@
id Monitor;
NSWindow* Window;

ImGui_ImplOSX_Data() { memset(this, 0, sizeof(*this)); }
ImGui_ImplOSX_Data() { memset((void*)this, 0, sizeof(*this)); }
};

static ImGui_ImplOSX_Data* ImGui_ImplOSX_GetBackendData() { return (ImGui_ImplOSX_Data*)ImGui::GetIO().BackendPlatformUserData; }
Expand Down
6 changes: 3 additions & 3 deletions backends/imgui_impl_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void ImGui_ImplVulkan_RenderDrawData(ImDrawData* draw_data, VkCommandBuffer comm
wrb->Index = 0;
wrb->Count = v->ImageCount;
wrb->FrameRenderBuffers = (ImGui_ImplVulkan_FrameRenderBuffers*)IM_ALLOC(sizeof(ImGui_ImplVulkan_FrameRenderBuffers) * wrb->Count);
memset(wrb->FrameRenderBuffers, 0, sizeof(ImGui_ImplVulkan_FrameRenderBuffers) * wrb->Count);
memset((void*)wrb->FrameRenderBuffers, 0, sizeof(ImGui_ImplVulkan_FrameRenderBuffers) * wrb->Count);
}
IM_ASSERT(wrb->Count == v->ImageCount);
wrb->Index = (wrb->Index + 1) % wrb->Count;
Expand Down Expand Up @@ -1494,8 +1494,8 @@ void ImGui_ImplVulkanH_CreateWindowSwapChain(VkPhysicalDevice physical_device, V
wd->SemaphoreCount = wd->ImageCount + 1;
wd->Frames = (ImGui_ImplVulkanH_Frame*)IM_ALLOC(sizeof(ImGui_ImplVulkanH_Frame) * wd->ImageCount);
wd->FrameSemaphores = (ImGui_ImplVulkanH_FrameSemaphores*)IM_ALLOC(sizeof(ImGui_ImplVulkanH_FrameSemaphores) * wd->SemaphoreCount);
memset(wd->Frames, 0, sizeof(wd->Frames[0]) * wd->ImageCount);
memset(wd->FrameSemaphores, 0, sizeof(wd->FrameSemaphores[0]) * wd->SemaphoreCount);
memset((void*)wd->Frames, 0, sizeof(wd->Frames[0]) * wd->ImageCount);
memset((void*)wd->FrameSemaphores, 0, sizeof(wd->FrameSemaphores[0]) * wd->SemaphoreCount);
for (uint32_t i = 0; i < wd->ImageCount; i++)
wd->Frames[i].Backbuffer = backbuffers[i];
}
Expand Down
52 changes: 30 additions & 22 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ HOW TO UPDATE?
- Please report any issue!

-----------------------------------------------------------------------
VERSION 1.91.5 WIP (In Progress)
VERSION 1.91.5 (Released 2024-11-07)
-----------------------------------------------------------------------

Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.91.5

Breaking changes:

- Commented out pre-1.87 IO system (equivalent to using IMGUI_DISABLE_OBSOLETE_KEYIO or IMGUI_DISABLE_OBSOLETE_FUNCTIONS before).
Expand All @@ -47,34 +49,38 @@ Breaking changes:
- Pre-1.87 backends are not supported:
- backends need to call io.AddKeyEvent(), io.AddMouseEvent() instead of writing to io.KeysDown[], io.MouseDown[] fields.
- backends need to call io.AddKeyAnalogEvent() for gamepad values instead of writing to io.NavInputs[] fields.
- For more reference:
- read 1.87 and 1.88 part of this section or read Changelog for 1.87 and 1.88.
- For more references:
- read 1.87 and 1.88 part of API BREAKING CHANGES in imgui.cpp or read Changelog for 1.87 and 1.88.
- read https://github.com/ocornut/imgui/issues/4921
- If you have trouble updating a very old codebase using legacy backend-specific key codes:
consider updating to 1.91.4 first, then #define IMGUI_DISABLE_OBSOLETE_KEYIO, then update to latest.
- Obsoleted ImGuiKey_COUNT (it is unusually error-prone/misleading since valid keys don't start at 0).
Probably use ImGuiKey_NamedKey_BEGIN/ImGuiKey_NamedKey_END?
- Fonts: removed const qualifiers from most font functions in prevision for upcoming fonts improvements.

Other changes:

- Selectable: selected Selectables use ImGuiCol_Header instead of an arbitrary lerp
between _Header and _HeaderHovered which was introduced v1.91 (#8106, #1861)
- Buttons: using ImGuiItemFlags_ButtonRepeat makes default button behavior use
PressedOnClick instead of PressedOnClickRelease when unspecified.
- Fonts: removed const qualifiers from most font functions.
- InputText: fixed a bug (regression in 1.91.2) where modifying text buffer within
a callback would sometimes prevents further appending to the buffer.
- Log/Capture: better decorating of BeginMenu() and TabItem() output.
- Log/Capture: a non terminated log ends automatically in the window which called it.
- Tabs, Style: made ImGuiCol_TabDimmedSelectedOverline alpha 0 (not visible) in default
styles as the current look is not right (but ImGuiCol_TabSelectedOverline stays the same).
- Log/Capture: added experimental io.ConfigWindowsCopyContentsWithCtrlC option to
automatically copy window contents into clipboard using CTRL+C. This is experimental
because (1) it currently breaks on nested Begin/End, (2) text output quality varies,
and (3) text output comes in submission order rather than spatial order.
- Log/Capture: better decorating of BeginMenu() and TabItem() output.
- Log/Capture: a non terminated log ends automatically in the window which called it.
- imgui_freetype: Fixed a crash in build font atlas when using merged fonts and the
first font in a merged set has no loaded glyph. (#8081)
- Backends: DX12: Unmap() call specify written range. The range is informational and
may be used by debug tools.
- Backends: SDL2: Replace SDL_Vulkan_GetDrawableSize() forward declaration with the
actual include. (#8095, #7967, #3190) [@sev-]
- Backends: SDL2, SDL3: SDL_EVENT_MOUSE_WHEEL event doesn't require dividing
- Backends: SDL2: Replace SDL_Vulkan_GetDrawableSize() forward declaration with the
actual include. (#8095, #7967, #3190) [@sev-]
- Backends: SDL2, SDL3: SDL_EVENT_MOUSE_WHEEL event doesn't require dividing
by 100.0f on Emscripten target. (#4019, #6096, #1463)
- Examples: SDL3+Vulkan: Added example. (#8084, #8085)
- Examples: Android+OpenGL: Using ALooper_pollOnce() instead of ALooper_pollAll()
Expand All @@ -94,9 +100,11 @@ Docking+Viewports Branch:
VERSION 1.91.4 (Released 2024-10-18)
-----------------------------------------------------------------------

Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.91.4

Breaking changes:

- Style: renamed ImGuiCol_NavHighlight to ImGuiCol_NavCursor, for consistency with
- Style: renamed ImGuiCol_NavHighlight to ImGuiCol_NavCursor, for consistency with
newly exposed and reworked features. Kept inline redirection enum (will obsolete).
- The typedef for ImTextureID now defaults to ImU64 instead of void*. (#1641)
- This removes the requirement to redefine it for backends which are e.g. storing
Expand All @@ -112,9 +120,9 @@ Breaking changes:
- Note that you can always define ImTextureID to be your own high-level structures
(with dedicated constructors and extra render parameters) if you like.
- IO: moved ImGuiConfigFlags_NavEnableSetMousePos to standalone io.ConfigNavMoveSetMousePos bool.
- IO: moved ImGuiConfigFlags_NavNoCaptureKeyboard to standalone io.ConfigNavCaptureKeyboard bool
- IO: moved ImGuiConfigFlags_NavNoCaptureKeyboard to standalone io.ConfigNavCaptureKeyboard bool
(note the inverted value!). (#2517, #2009)
Kept legacy names (will obsolete) + code that copies settings once the first time.
Kept legacy names (will obsolete) + code that copies settings once the first time.
Dynamically changing the old value won't work. Switch to using the new value!

Other changes:
Expand All @@ -130,48 +138,48 @@ Other changes:
- Set io.ConfigNavCursorVisibleAuto = true (default) to enable automatic toggling
of cursor visibility (mouse click hide the cursor, arrow keys makes it visible).
- Set io.ConfigNavCursorVisibleAlways to keep cursor always visible.
- Nav: added NavSetCursorVisible(bool visible) function to manipulate visibility of
- Nav: added NavSetCursorVisible(bool visible) function to manipulate visibility of
navigation cursor (e.g. set default state, or after some actions). (#1074, #2048, #7237, #8059)
- Nav: added io.ConfigNavEscapeClearFocusItem and io.ConfigNavEscapeClearFocusWindow to change
how pressing Escape affects navigation. (#8059, #2048, #1074, #3200)
- Set io.ConfigNavEscapeClearFocusItem = true (default) to clear focused item and highlight.
- Set io.ConfigNavEscapeClearFocusItem = false for Escape to not have an effect.
- Set io.ConfigNavEscapeClearFocusWindow = true to completely unfocus the dear imgui window,
is for some reason your app relies on imgui focus to take other decisions.
is for some reason your app relies on imgui focus to take other decisions.
- Nav: pressing escape to hide the navigation cursor doesn't clear location, so it may be
restored when Ctrl+Tabbing back into the same window later.
- Nav: fixed Ctrl+Tab initiated with no focused window from skipping the top-most window. (#3200)
- Nav: navigation cursor is not rendered for items with `ImGuiItemFlags_NoNav`. Can be relevant
- Nav: navigation cursor is not rendered for items with `ImGuiItemFlags_NoNav`. Can be relevant
when e.g activating a _NoNav item with mouse, then Ctrl+Tabbing back and forth.
- Disabled: clicking a disabled item focuses parent window. (#8064)
- Disabled: clicking a disabled item focuses parent window. (#8064)
- InvisibleButton, Nav: fixed an issue when InvisibleButton() would be navigable into but
not display navigation highlight. Properly navigation on it by default. (#8057)
- InvisibleButton: added ImGuiButtonFlags_EnableNav to enable navigation. (#8057)
- Tooltips: fixed incorrect tooltip positioning when using keyboard/gamepad navigation
- Tooltips: fixed incorrect tooltip positioning when using keyboard/gamepad navigation
(1.91.3 regression). (#8036)
- DrawList: AddCallback() added an optional size parameter allowing to copy and
store any amount of user data for usage by callbacks: (#6969, #4770, #7665)
- If userdata_size == 0: we copy/store the 'userdata' argument as-is (existing behavior).
It will be available unmodified in ImDrawCmd::UserCallbackData during render.
- If userdata_size > 0, we copy/store 'userdata_size' bytes pointed to by 'userdata' (new behavior).
We store them in a buffer stored inside the drawlist. ImDrawCmd::UserCallbackData
We store them in a buffer stored inside the drawlist. ImDrawCmd::UserCallbackData
will point inside that buffer so you have to retrieve data from there. Your callback
may need to use ImDrawCmd::UserCallbackDataSize if you expect dynamically-sized data.
- Note that we use a raw type-less copy.
- Tables: fixed initial auto-sizing issue with synced-instances. (#8045, #7218)
- InputText: fixed an issue with not declaring ownership of Delete/Backspace/Arrow keys,
preventing use of external shortcuts that are not guarded by an ActiveId check. (#8048)
preventing use of external shortcuts that are not guarded by an ActiveId check. (#8048)
[@geertbleyen]
- InputText: ensure mouse cursor shape is set regardless of whether keyboard mode is
- InputText: ensure mouse cursor shape is set regardless of whether keyboard mode is
enabled or not. (#6417)
- InputScalar: added an assert to clarify that ImGuiInputTextFlags_EnterReturnsTrue is not
supported by InputFloat, InputInt, InputScalar etc. widgets. It actually never was. (#8065, #3946)
- imgui_freetype: Added support for plutosvg (as an alternative to lunasvg) to render
- imgui_freetype: Added support for plutosvg (as an alternative to lunasvg) to render
OpenType SVG fonts. Requires defining IMGUI_ENABLE_FREETYPE_PLUTOSVG along with IMGUI_ENABLE_FREETYPE.
Providing headers/librairies for plutosvg + plutovg is up to you (see #7927 for help).
(#7927, #7187, #6591, #6607) [@pthom]
- Backends: DX11, DX12, SDLRenderer2/3. Vulkan, WGPU: expose selected state in
ImGui_ImplXXXX_RenderState structures during render loop user draw callbacks.
ImGui_ImplXXXX_RenderState structures during render loop user draw callbacks.
(#6969, #5834, #7468, #3590)
- Backends: DX9, DX10, DX11, DX12, OpenGL, Vulkan, WGPU: Changed default texture sampler
to Clamp instead of Repeat/Wrap. (#7468, #7511, #5999, #5502, #7230)
Expand Down
4 changes: 3 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.91.5 WIP
// dear imgui, v1.91.5
// (main code and documentation)

// Help:
Expand Down Expand Up @@ -448,6 +448,7 @@ CODE
- read https://github.com/ocornut/imgui/issues/4921
- if you have trouble updating a very old codebase using legacy backend-specific key codes: consider updating to 1.91.4 first, then #define IMGUI_DISABLE_OBSOLETE_KEYIO, then update to latest.
- obsoleted ImGuiKey_COUNT (it is unusually error-prone/misleading since valid keys don't start at 0). probably use ImGuiKey_NamedKey_BEGIN/ImGuiKey_NamedKey_END?
- fonts: removed const qualifiers from most font functions in prevision for upcoming font improvements.
- 2024/10/18 (1.91.4) - renamed ImGuiCol_NavHighlight to ImGuiCol_NavCursor (for consistency with newly exposed and reworked features). Kept inline redirection enum (will obsolete).
- 2024/10/14 (1.91.4) - moved ImGuiConfigFlags_NavEnableSetMousePos to standalone io.ConfigNavMoveSetMousePos bool.
moved ImGuiConfigFlags_NavNoCaptureKeyboard to standalone io.ConfigNavCaptureKeyboard bool (note the inverted value!).
Expand Down Expand Up @@ -1145,6 +1146,7 @@ CODE
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
#elif defined(__GNUC__)
// We disable -Wpragmas because GCC doesn't provide a has_warning equivalent and some forks/patches may not follow the warning/version association.
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
Expand Down
12 changes: 7 additions & 5 deletions imgui.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.91.5 WIP
// dear imgui, v1.91.5
// (headers)

// Help:
Expand Down Expand Up @@ -28,8 +28,8 @@

// Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.91.5 WIP"
#define IMGUI_VERSION_NUM 19144
#define IMGUI_VERSION "1.91.5"
#define IMGUI_VERSION_NUM 19150
#define IMGUI_HAS_TABLE
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
#define IMGUI_HAS_DOCK // Docking WIP branch
Expand Down Expand Up @@ -137,6 +137,7 @@ Index of this file:
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning: zero as null pointer constant
#pragma clang diagnostic ignored "-Wreserved-identifier" // warning: identifier '_Xxx' is reserved because it starts with '_' followed by a capital letter
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" // warning: 'xxx' is an unsafe pointer used for buffer access
#pragma clang diagnostic ignored "-Wnontrivial-memaccess" // warning: first argument in call to 'memset' is a pointer to non-trivially copyable type
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
Expand Down Expand Up @@ -3393,11 +3394,12 @@ struct ImFontAtlasCustomRect
{
unsigned short Width, Height; // Input // Desired rectangle dimension
unsigned short X, Y; // Output // Packed position in Atlas
unsigned int GlyphID; // Input // For custom font glyphs only (ID < 0x110000)
unsigned int GlyphID : 31; // Input // For custom font glyphs only (ID < 0x110000)
unsigned int GlyphColored : 1; // Input // For custom font glyphs only: glyph is colored, removed tinting.
float GlyphAdvanceX; // Input // For custom font glyphs only: glyph xadvance
ImVec2 GlyphOffset; // Input // For custom font glyphs only: glyph display offset
ImFont* Font; // Input // For custom font glyphs only: target font
ImFontAtlasCustomRect() { Width = Height = 0; X = Y = 0xFFFF; GlyphID = 0; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0, 0); Font = NULL; }
ImFontAtlasCustomRect() { Width = Height = 0; X = Y = 0xFFFF; GlyphID = 0; GlyphColored = 0; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0, 0); Font = NULL; }
bool IsPacked() const { return X != 0xFFFF; }
};

Expand Down
2 changes: 1 addition & 1 deletion imgui_demo.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.91.5 WIP
// dear imgui, v1.91.5
// (demo code)

// Help:
Expand Down
Loading

0 comments on commit 368123a

Please sign in to comment.