Skip to content

Upgrade ImGui to v1.92.7-docking and Dear Bindings to v0.19#500

Open
pusewicz wants to merge 1 commit intoRandyGaul:masterfrom
pusewicz:imgui-v1.92.7
Open

Upgrade ImGui to v1.92.7-docking and Dear Bindings to v0.19#500
pusewicz wants to merge 1 commit intoRandyGaul:masterfrom
pusewicz:imgui-v1.92.7

Conversation

@pusewicz
Copy link
Copy Markdown
Contributor

Summary

Bumps the vendored Dear ImGui from v1.92.3-docking to v1.92.7-docking and the matching Dear Bindings C wrappers (dcimgui*) to the DearBindings_v0.19_ImGui_v1.92.7-docking release.

What changed

  • Core ImGui (libraries/imgui/): imgui.{h,cpp}, imgui_internal.h, imgui_demo/draw/tables/widgets.cpp, imstb_*.h, LICENSE.txt — overwritten from upstream tag v1.92.7-docking.
  • Backends (libraries/imgui/backends/): imgui_impl_sdl3.{h,cpp}, imgui_impl_sdlgpu3.{h,cpp}, imgui_impl_sdlgpu3_shaders.h, imgui_impl_opengl3.{h,cpp}, imgui_impl_opengl3_loader.h — overwritten from the same
    upstream tag.
  • Dear Bindings (libraries/imgui/dcimgui*.{h,cpp}): replaced with the pre-generated outputs from the DearBindings_v0.19_ImGui_v1.92.7-docking release.

CF-specific patches re-applied

  • imconfig.h: #include <cute_math.h>, #define IMGUI_STB_NAMESPACE ImStb, #define IMGUI_API CF_API, #define CIMGUI_API CF_API, and the IM_VEC2_CLASS_EXTRA macro that bridges ImVec2 ↔ CF_V2.
  • dcimgui.h: #define IMGUI_STB_NAMESPACE ImStb near the top.

One workaround patch

  • dcimgui_internal.h: moved struct ImVector_stbrp_node_im_t { ... }; outside the #ifdef IMGUI_STB_NAMESPACE conditional. Dear Bindings v0.19 only emits this struct in the #else branch, which leaves the type
    incomplete when IMGUI_STB_NAMESPACE is set and breaks ImFontAtlasBuilder_t::PackNodes. v0.18 (used by 1.92.3) emitted it in both branches; this looks like an upstream regression worth filing.

How it was done

  1. Downloaded files from https://raw.githubusercontent.com/ocornut/imgui/v1.92.7-docking/....
  2. Downloaded the four dcimgui* files from the dear_bindings GitHub release assets.
  3. Overwrote files under libraries/imgui/, then re-applied the CF patches above.
  4. Verified cmake --build build --target cute (only the pre-existing cute_tls.h enum-compare warnings) and cmake --build build --target imgui (sample links cleanly).

Compatibility

CF source uses only ImGui::GetIO/DestroyContext/GetDrawData and the ImGui_Impl* entry points; samples use stable widget APIs. None of the v1.92.4–v1.92.7 breaking changes (SelectOnClick → SelectOnAuto, removed
legacy Combo/ListBox callback signatures, Separator height fix, popup flag default change, Vulkan reorg, etc.) affect this codebase.

🤖 Automated upgrade using Claude.

Updates the vendored ImGui core, the SDL3 / SDL_GPU3 / OpenGL3
backends, and the Dear Bindings C wrappers (dcimgui*) to match the
DearBindings_v0.19_ImGui_v1.92.7-docking release.

CF-specific patches preserved in imconfig.h (cute_math include,
IMGUI_STB_NAMESPACE, IMGUI_API/CIMGUI_API CF_API, IM_VEC2_CLASS_EXTRA
ImVec2<->CF_V2 bridge) and dcimgui.h (IMGUI_STB_NAMESPACE define).

dcimgui_internal.h: emit struct ImVector_stbrp_node_im_t
unconditionally. Dear Bindings v0.19 only emits it in the
non-IMGUI_STB_NAMESPACE branch, leaving the type incomplete and
breaking ImFontAtlasBuilder_t::PackNodes when a namespace is set.
Copilot AI review requested due to automatic review settings April 28, 2026 06:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR upgrades the vendored Dear ImGui docking branch to v1.92.7 and updates the matching Dear Bindings (dcimgui*) C wrappers to v0.19, including updated SDL3/SDL_gpu3/OpenGL3 backends and regenerated bindings glue.

Changes:

  • Vendor update: ImGui core + stb headers refreshed to v1.92.7-docking.
  • Backend updates: SDL3, SDL_gpu3 and OpenGL3 backend implementations updated to match upstream.
  • Dear Bindings update: regenerated dcimgui* wrappers/glue updated for new internal/public APIs.

Reviewed changes

Copilot reviewed 18 out of 24 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
libraries/imgui/imstb_truetype.h Upstream stb_truetype sync (minor comment fixes).
libraries/imgui/imstb_textedit.h Upstream stb_textedit sync (insert API returns count; history/docs updated).
libraries/imgui/imstb_rectpack.h Upstream stb_rectpack sync (comment typo fixes).
libraries/imgui/imgui_tables.cpp Upstream tables implementation updates (reorder/display order, asserts, draw channel logic).
libraries/imgui/imgui_internal.h Upstream internal API/struct updates and new helpers/macros.
libraries/imgui/imconfig.h Project-specific config patches re-applied + upstream comment updates.
libraries/imgui/dcimgui_internal.cpp Regenerated Dear Bindings internal glue updates for new ImGui APIs.
libraries/imgui/dcimgui.cpp Regenerated Dear Bindings public glue updates + some obsolete wrapper removals/additions.
libraries/imgui/backends/imgui_impl_sdlgpu3_shaders.h Updated embedded shader blobs (adds MSL sources).
libraries/imgui/backends/imgui_impl_sdlgpu3.h SDL_gpu3 backend API/struct updates (sampler split, nullptr docs).
libraries/imgui/backends/imgui_impl_sdlgpu3.cpp SDL_gpu3 backend updates (shader format selection, texture destroy fix, sampler creation, shutdown handler cleanup).
libraries/imgui/backends/imgui_impl_sdl3.h SDL3 backend API updates (mouse capture mode override API).
libraries/imgui/backends/imgui_impl_sdl3.cpp SDL3 backend updates (IME refactor, monitor event, clipboard behavior, platform handler cleanup, parent viewport support).
libraries/imgui/backends/imgui_impl_opengl3_loader.h Embedded imgl3w loader updates (clear procs on shutdown).
libraries/imgui/backends/imgui_impl_opengl3.h OpenGL3 backend header doc tweak (nullptr).
libraries/imgui/backends/imgui_impl_opengl3.cpp OpenGL3 backend updates (loader lifecycle, texture invalid ID handling, shutdown handler cleanup).
libraries/imgui/LICENSE.txt License year bumped to 2026 (upstream sync).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +220 to +225
ImVec2 viewport_pos;
if (ImGuiViewport* viewport = ImGui_ImplSDL3_GetViewportForWindowID(SDL_GetWindowID(window)))
viewport_pos = viewport->Pos;
SDL_Rect r;
r.x = (int)(data->InputPos.x - viewport->Pos.x);
r.y = (int)(data->InputPos.y - viewport->Pos.y + data->InputLineHeight);
r.x = (int)(data->InputPos.x - viewport_pos.x);
r.y = (int)(data->InputPos.y - viewport_pos.y);
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

viewport_pos is used even when ImGui_ImplSDL3_GetViewportForWindowID() returns null, leaving it uninitialized and causing undefined IME rectangle coordinates. Initialize it (e.g., to (0,0)) before the conditional (or set it from ImGui::GetMainViewport() as a fallback).

Copilot uses AI. Check for mistakes.
fragment_shader_info.format = SDL_GPU_SHADERFORMAT_MSL;
fragment_shader_info.code = msl_fragment;
fragment_shader_info.code_size = sizeof(msl_fragment);
}
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If neither SDL_GPU_SHADERFORMAT_METALLIB nor SDL_GPU_SHADERFORMAT_MSL is reported by SDL_GetGPUShaderFormats(), shader infos remain unset and the later SDL_CreateGPUShader() calls are likely to fail in a non-obvious way. Add an explicit else path that logs/ASSERTs with the supported format mask (or returns early), so misconfigured devices fail fast with a clear error.

Suggested change
}
}
else
{
SDL_LogError(SDL_LOG_CATEGORY_RENDER, "ImGui_ImplSDLGPU3_CreateShaders(): unsupported Apple SDL_GPU shader format mask 0x%x", (unsigned int)supported_formats);
IM_ASSERT(false && "ImGui_ImplSDLGPU3_CreateShaders(): device does not support METALLIB or MSL shader formats");
return;
}

Copilot uses AI. Check for mistakes.
148,161,0,0,0,0,109,97,105,110,48,97,105,114,46,115,97,109,112,108,101,95,116,101,120,116,117,114,101,95,50,100,46,118,52,102,51,50,51,50,48,50,51,46,51,54,56,97,105,114,54,52,45,97,
112,112,108,101,45,109,97,99,111,115,120,49,52,46,48,46,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
static uint8_t msl_vertex[800] =
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shader byte arrays are not modified at runtime and should be static const uint8_t ... to place them in read-only storage and prevent accidental mutation. This also better communicates intent and can reduce writable-data footprint.

Suggested change
static uint8_t msl_vertex[800] =
static const uint8_t msl_vertex[800] =

Copilot uses AI. Check for mistakes.
116,95,67,111,108,111,114,32,61,32,79,117,116,46,67,111,108,111,114,59,10,32,32,32,32,111,117,116,46,79,117,116,95,85,86,32,61,32,79,117,116,46,85,86,59,10,32,32,32,32,114,101,116,
117,114,110,32,111,117,116,59,10,125,10,10,
};
static uint8_t msl_fragment[580] =
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shader byte arrays are not modified at runtime and should be static const uint8_t ... to place them in read-only storage and prevent accidental mutation. This also better communicates intent and can reduce writable-data footprint.

Suggested change
static uint8_t msl_fragment[580] =
static const uint8_t msl_fragment[580] =

Copilot uses AI. Check for mistakes.
// large height (= first frame scrollbar display very off + clipper would skip lots of items).
// This is merely making the side-effect less extreme, but doesn't properly fixes it.
// FIXME: Move this to ->WidthGiven to avoid temporary lossyless?
// FIXME: Move this to ->WidthGiven to avoid temporary lossyness?
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: 'lossyness' should be 'lossiness'.

Suggested change
// FIXME: Move this to ->WidthGiven to avoid temporary lossyness?
// FIXME: Move this to ->WidthGiven to avoid temporary lossiness?

Copilot uses AI. Check for mistakes.
}
}
// By-value struct conversions
#undef DEAR_BINDINGS_INTERNAL_GLUE_CODE// By-value struct conversions
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #undef directive is immediately followed by a comment with no whitespace, which hurts readability and makes the directive easy to miss. Put the comment on its own line or add spacing, e.g. keep #undef DEAR_BINDINGS_INTERNAL_GLUE_CODE on a standalone line.

Suggested change
#undef DEAR_BINDINGS_INTERNAL_GLUE_CODE// By-value struct conversions
#undef DEAR_BINDINGS_INTERNAL_GLUE_CODE
// By-value struct conversions

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants