Skip to content

Commit

Permalink
Update Dear ImGui to v1.91.3
Browse files Browse the repository at this point in the history
no changes in the code using it were necessary
  • Loading branch information
DanielGibson committed Oct 5, 2024
1 parent 9f21cea commit 60ec314
Show file tree
Hide file tree
Showing 13 changed files with 855 additions and 467 deletions.
2 changes: 1 addition & 1 deletion neo/libs/imgui/backends/imgui_impl_sdl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static void ImGui_ImplSDL3_UpdateMouseData()
// We forward mouse input when hovered or captured (via SDL_EVENT_MOUSE_MOTION) or when focused (below)
#if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE
// SDL_CaptureMouse() let the OS know e.g. that our imgui drag outside the SDL window boundaries shouldn't e.g. trigger other operations outside
SDL_CaptureMouse((bd->MouseButtonsDown != 0) ? SDL_TRUE : SDL_FALSE);
SDL_CaptureMouse(bd->MouseButtonsDown != 0);
SDL_Window* focused_window = SDL_GetKeyboardFocus();
const bool is_app_focused = (bd->Window == focused_window);
#else
Expand Down
4 changes: 2 additions & 2 deletions neo/libs/imgui/backends/imgui_impl_sdlrenderer3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
SDL_Rect ClipRect;
};
BackupSDLRendererState old = {};
old.ViewportEnabled = SDL_RenderViewportSet(renderer) == SDL_TRUE;
old.ClipEnabled = SDL_RenderClipEnabled(renderer) == SDL_TRUE;
old.ViewportEnabled = SDL_RenderViewportSet(renderer);
old.ClipEnabled = SDL_RenderClipEnabled(renderer);
SDL_GetRenderViewport(renderer, &old.Viewport);
SDL_GetRenderClipRect(renderer, &old.ClipRect);

Expand Down
6 changes: 4 additions & 2 deletions neo/libs/imgui/backends/imgui_impl_wgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,15 @@ static WGPUProgrammableStageDescriptor ImGui_ImplWGPU_CreateShaderModule(const c
{
ImGui_ImplWGPU_Data* bd = ImGui_ImplWGPU_GetBackendData();

WGPUShaderModuleWGSLDescriptor wgsl_desc = {};
#ifdef IMGUI_IMPL_WEBGPU_BACKEND_DAWN
WGPUShaderSourceWGSL wgsl_desc = {};
wgsl_desc.chain.sType = WGPUSType_ShaderSourceWGSL;
wgsl_desc.code = { wgsl_source, WGPU_STRLEN };
#else
WGPUShaderModuleWGSLDescriptor wgsl_desc = {};
wgsl_desc.chain.sType = WGPUSType_ShaderModuleWGSLDescriptor;
wgsl_desc.code = wgsl_source;
#endif
wgsl_desc.code = wgsl_source;

WGPUShaderModuleDescriptor desc = {};
desc.nextInChain = reinterpret_cast<WGPUChainedStruct*>(&wgsl_desc);
Expand Down
70 changes: 70 additions & 0 deletions neo/libs/imgui/docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,82 @@ HOW TO UPDATE?
and API updates have been a little more frequent lately. They are documented below and in imgui.cpp and should not affect all users.
- Please report any issue!

-----------------------------------------------------------------------
VERSION 1.91.3 (Released 2024-10-04)
-----------------------------------------------------------------------

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

Breaking changes:

- Drags: treat v_min==v_max as a valid clamping range when != 0.0f. Zero is still a special
value due to legacy reasons, unless using ImGuiSliderFlags_ClampZeroRange. (#7968, #3361, #76)
- Drags: extended behavior of ImGuiSliderFlags_AlwaysClamp to include _ClampZeroRange.
It considers v_min==v_max==0.0f as a valid clamping range (aka edits not allowed).
Although unlikely, it you wish to only clamp on text input but want v_min==v_max==0.0f
to mean unclamped drags, you can use _ClampOnInput instead of _AlwaysClamp. (#7968, #3361, #76)

Other changes:

- Error Handling: Enabled/improved error recovery systems. (#1651, #5654)
- Error recovery is provided as a way to facilitate:
- Recovery after a programming error. Native code or scripting language (the later
tends to facilitate iterating on code while running).
- Recovery after running an exception handler or any error processing which may skip code
after an error has been detected.
- Error recovery is not perfect nor guaranteed! It is a feature to ease development.
You not are not supposed to rely on it in the course of a normal application run.
- Functions that support error recovery are using IM_ASSERT_USER_ERROR() instead of IM_ASSERT().
- By design, we do not allow error recovery to be 100% silent. One of the options needs to be enabled!
- Possible usage: facilitate recovery from errors triggered from a scripting language or
after specific exceptions handlers. Surface errors to programmers in less aggressive ways.
- Always ensure that on programmers seats you have at minimum Asserts or Tooltips enabled
when making direct imgui API calls! Otherwise it would severely hinder your ability to
catch and correct mistakes!
- Added io.ConfigErrorRecovery to enable error recovery support.
- Added io.ConfigErrorRecoveryEnableAssert to assert on recoverable errors.
- Added io.ConfigErrorRecoveryEnableDebugLog to output to debug log on recoverable errors.
- Added io.ConfigErrorRecoveryEnableTooltip to enable displaying an error tooltip on recoverable errors.
The tooltip include a way to enable asserts if they were disabled.
- All options are enabled by default.
- Read https://github.com/ocornut/imgui/wiki/Error-Handling for a bit more details.
- Windows: BeginChild(): made it possible to call SetNextWindowSize() on a child window
using ImGuiChildFlags_ResizeX,ImGuiChildFlags_ResizeY in order to override its current
size. (#1710, #8020)
- Scrollbar: Shift+Click scroll to clicked location (pre-1.90.8 default). (#8002, #7328)
- Scrollbar: added io.ConfigScrollbarScrollByPage setting (default to true). (#8002, #7328)
Set io.ConfigScrollbarScrollByPage=false to enforce always scrolling to clicked location.
- Drags: split ImGuiSliderFlags_AlwaysClamp into two distinct flags: (#7968, #3361, #76)
- ImGuiSliderFlags_AlwaysClamp = ImGuiSliderFlags_ClampOnInput + ImGuiSliderFlags_ClampZeroRange.
- Previously _AlwaysClamp only did the equivalent of _ClampOnInput.
- Added ImGuiSliderFlags_ClampOnInput which is now a subset of AlwaysClamp.
(note that it was the old name of AlwaysClamp, but we are reintroducing that name).
- Added ImGuiSliderFlags_ClampZeroRange to enforce clamping even when v_min==v_max==0.0f
in drag functions. Sliders are not affected.
- Tooltips, Drag and Drop: Fixed an issue where the fallback drag and drop payload tooltip
appeared during drag and drop release.
- Tooltips, Drag and Drop: Stabilized name of drag and drop tooltip window so that
transitioning from an item tooltip to a drag tooltip doesn't leak window auto-sizing
info from one to the other. (#8036)
- Tooltips: Tooltips triggered from touch inputs are positioned above the item. (#8036)
- Backends: SDL3: Update for API changes: SDL_bool removal. SDL_INIT_TIMER removal.
- Backends: WebGPU: Fixed DAWN api change using WGPUStringView in WGPUShaderSourceWGSL.
(#8009, #8010) [@blitz-research]

-----------------------------------------------------------------------
VERSION 1.91.2 (Released 2024-09-19)
-----------------------------------------------------------------------

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

Breaking changes:

- Internals: using multiple overlayed ButtonBehavior() with same ID will now have the
io.ConfigDebugHighlightIdConflicts=true feature emit a warning. (#8030)
It was one of the rare case where using same ID is legal. Workarounds:
- use single ButtonBehavior() call with multiple _MouseButton flags
- or surround the calls with PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag()

Other changes:

- Added io.ConfigDebugHighlightIdConflicts debug feature! (#7961, #7669)
Expand Down
2 changes: 1 addition & 1 deletion neo/libs/imgui/examples/example_sdl3_opengl3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
int main(int, char**)
{
// Setup SDL
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMEPAD))
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD))
{
printf("Error: SDL_Init(): %s\n", SDL_GetError());
return -1;
Expand Down
2 changes: 1 addition & 1 deletion neo/libs/imgui/examples/example_sdl3_sdlrenderer3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
int main(int, char**)
{
// Setup SDL
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMEPAD))
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD))
{
printf("Error: SDL_Init(): %s\n", SDL_GetError());
return -1;
Expand Down
Loading

0 comments on commit 60ec314

Please sign in to comment.