Repository navigation
Conversation
Updates all four vendored trees (master, docking, and the freetype variants) from v1.91.3 to v1.92.7 via third-party/update-imgui.sh, and bumps the tags the script pins.
Generated with cimgui 0e533fd, the revision contemporary with imgui 1.92.7 (cimgui master has since had a cpp2ffi refactor). xtask changes needed to drive bindgen 0.72 and the 1.92-era cimgui output: - `--size_t-is-usize` was removed from bindgen; it is the default now. - `--ctypes-prefix` has to be `core::ffi` rather than the `cty` shim, which is what the committed bindings already used. - cimgui 1.92 leaves `IMGUI_USE_WCHAR32` and `IMGUI_ENABLE_FREETYPE` as `#ifdef`s in the generated header instead of resolving them at generation time, so bindgen has to be given the same defines imgui-sys compiles the C++ with. Without `-DIMGUI_USE_WCHAR32` the header's `#else` branch wins and `ImWchar` would silently bind as 16-bit.
Mechanical half of the 1.92 port. Does not compile yet: see the two groups left in `FontAtlas` and `FontGlyphRanges` below. - cimgui now returns ImVec2 by value instead of through an out-parameter. - Textures are passed as ImTextureRef; TextureId gains as_tex_ref(), and ImDrawCmd::TextureId became TexRef (resolved via ImTextureRef_GetTexID). - igImage lost its border colour (borders come from ImGuiCol_Border now), so the tinted path goes through igImageWithBg. - PushFont requires a size; push_font() keeps the font's own LegacySize. - ImDrawList_AddCallback takes a userdata size. - New 1.92 enum slots: ImGuiKey_Oem102, MouseCursor Wait/Progress, and the StyleColor slots InputTextCursor/TreeLines/DragDropTargetBg/UnsavedMarker. - FontAtlas is now a transparent wrapper over sys::ImFontAtlas rather than a hand-maintained field mirror: 1.92 reworked the atlas, and a drifting mirror corrupts memory instead of failing to compile. FontConfig follows the renames (GlyphExtraAdvanceX, FontLoaderFlags, 8-bit oversampling). Renames and moves that IMGUI_DISABLE_OBSOLETE_FUNCTIONS makes load-bearing: - ImGuiCol_NavHighlight -> ImGuiCol_NavCursor (StyleColor::NavCursor). - ImGuiTreeNodeFlags_NavLeftJumpsBackHere -> NavLeftJumpsToParent, and the builder method follows it. - ImGuiTabBarFlags_FittingPolicyResizeDown -> FittingPolicyShrink. - ImGuiColorEditFlags_AlphaPreview was removed in 1.91.8: a transparent preview is the default now, and AlphaOpaque restores the old behaviour, so ColorPreview maps onto ALPHA_OPAQUE rather than ALPHA_PREVIEW. AlphaNoBg is exposed as well. - ImGuiConfigFlags_NavEnableSetMousePos / _NavNoCaptureKeyboard moved out of ImGuiConfigFlags in 1.91.4 and are now io booleans. - ImGui::SetWindowFontScale() is obsolete with no drop-in replacement, so Ui::set_window_font_scale is removed pending a maintainer decision.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows on from #834 and from @jestarray's request that I open a PR.
Draft, deliberately.
imgui-sysbuilds; theimguicrate does not compile yet. Ten errors remain, in two groups, both of which I think are your calls rather than mine (details at the bottom). Everything mechanical is done, including the parts that are tedious to reproduce locally.This is my
arcdps-1.92.7branch with the fork-specific bits taken back out:IMGUI_USE_WCHAR32andIMGUI_DISABLE_OBSOLETE_FUNCTIONSare restored to upstream's settings, soImWcharis 32-bit again and the obsolete API surface stays off. It is rebased on currentmainrather than carrying arcdps'simconfigchanges.What's here
1. Vendor Dear ImGui v1.92.7 — all four trees (
imgui-master,imgui-docking, and both freetype variants), not just master, viathird-party/update-imgui.shwith the pinned tags bumped.2. Regenerate cimgui + Rust bindings — generated with cimgui
0e533fd, the revision contemporary with 1.92.7. Note that cimgui master has since had a cpp2ffi refactor, so a newer cimgui will not reproduce this output.Three
xtask/src/bindgen.rsfixes were needed:--size_t-is-usizewas removed from bindgen; it is the default now.--ctypes-prefixhas to becore::ffirather than thectyshim. The committed bindings already usedcore::ffi, so this flag was already stale onmain.IMGUI_USE_WCHAR32andIMGUI_ENABLE_FREETYPEwhile generating — it leaves them as#ifdefs incimgui.h. bindgen therefore has to be passed the same definesimgui-sys/build.rscompiles the C++ with. Without-DIMGUI_USE_WCHAR32the header's#elsebranch wins andImWcharbinds as 16-bit against a 32-bit C++ build, silently. I've verified all eight generated files now resolveImWchar = ImWchar32, and that freetype/docking symbols appear only in their own variants.3. Port the high-level crate — the
ImVec2-by-value change,ImTextureRef/TexRef,igImageWithBg, sizedPushFont,AddCallbackuserdata size, the new enum slots, andFontAtlasrebuilt as a#[repr(transparent)]wrapper oversys::ImFontAtlas.Plus the renames that
IMGUI_DISABLE_OBSOLETE_FUNCTIONSmakes load-bearing:ImGuiCol_NavHighlight→NavCursor,NavLeftJumpsBackHere→NavLeftJumpsToParent,FittingPolicyResizeDown→FittingPolicyShrink, and theConfigFlagsnav entries that becameiobooleans in 1.91.4.ImGuiColorEditFlags_AlphaPreviewneeded more than a rename: 1.91.8 inverted the default, so a transparent preview is now standard andColorPreview::Opaquemaps onto the newAlphaOpaqueflag.What I've left for you
The font atlas (3 errors). With obsolete functions off,
ImFontAtlas::{Build, GetTexDataAsAlpha8, GetTexDataAsRGBA32, IsBuilt}are all gone, andImFontAtlasBuildMainisimgui_internalonly — not exposed even by the docking variant'sinternalgeneration. So there is no supported way to build the atlas and read pixels beforeNewFrame, which is exactly whatFontAtlas::build_rgba32_texture()and every renderer backend currently rely on.The 1.92 answer is for backends to set
ImGuiBackendFlags_RendererHasTexturesand drainImDrawData::Textureseach frame. That is a breaking change for every backend, so it wants a deliberate decision — though it's worth noting backends already break here regardless, sinceImDrawCmd::TextureIdbecameTexRef.Glyph ranges (7 errors). The seven non-default
GetGlyphRanges*helpers are obsolete-only now; onlyGetGlyphRangesDefaultsurvives. Either the tables get vendored into Rust soFontGlyphRanges::japanese()etc. keep working, or the helpers go and users move toImFontGlyphRangesBuilder/ dynamic loading. 1.92 considers explicit ranges unnecessary once a backend supportsRendererHasTextures, which argues for removal, but it is a visible API break either way.Two things I noticed but did not touch:
Iois a hand-maintained#[repr(C)]mirror ofImGuiIO, and 1.92 reordered that struct and droppedFontGlobalScale. It is wrong now.test_io_memory_layoutcatches it, so it fails loudly rather than corrupting silently, but it needs the same treatmentFontAtlasgot in this PR.Fontis a mirror ofImFontwith the same problem, and 1.92 reworkedImFontsubstantially.push_fontreadsLegacySizethroughsys::ImFontrather than throughFontfor this reason.This is the same hazard that motivated replacing the
FontAtlasmirror: a drifting#[repr(C)]mirror doesn't fail to compile, it corrupts memory.Expected CI state
CI on this PR will be red, and that is expected rather than a surprise:
ci.ymltriggers onpull_requestwith no draft filter, so thetestjob runs on all three OSes and fails — theimguicrate does not compile, per the two groups above.rustfmtandclippyjobs are gated ongithub.ref == 'refs/heads/main', so they do not run on this PR. There is no lint or formatting signal here, only the build.All this has been done by AI, so do check it. I will push it as a Draft so you have the important changes, but do not intend to revisit this, so if you want them, please finish it yourself.