Skip to content

Commit 32f4c23

Browse files
phraktleclaude
andauthored
feat(api): bump Dear ImGui from 1.90.9 to 1.92.7
* feat(api): bump Dear ImGui 1.90.9 -> 1.92.7-docking This is the substantial 21-month Dear ImGui catch-up. Upstream's 1.92.0 is the largest breaking release since 2015 (font subsystem rework, ImTextureRef, atlas rewrite), so this PR absorbs those in addition to the 1.91.x accumulated changes. Submodule bumps: - imgui: v1.90.9-docking -> v1.92.7-docking (~2088 commits, Apr 2026) - implot: 1f7a8c0 (2023) -> v0.17 (Nov 2025) -- required because the older implot doesn't compile against imgui 1.92 (missing FontSize / FindGlyph / CalcFontSize symbols). v0.17 has the 1.92 compat guards and is NON-BREAKING for Java consumers (still the old flags/offset/ stride API). The ImPlotSpec migration to implot v1.0 lands in its own separate PR. - imgui-node-editor: b302971 -> 021aa0e (+ a small local patch -- see patches/) - imnodes: 8563e16 -> b2ec254 -- upstream fix for imgui 1.92.0. The node-editor and imnodes bumps are required for imgui 1.92 compat, not cherry-picked. Key Java binding changes (consumer-visible): - ImFont: fields Ascent, Descent, FontSize, FallbackAdvanceX, FallbackGlyph, ConfigDataCount, EllipsisCharCount, EllipsisWidth, EllipsisCharStep, DirtyLookupTables were removed (moved to ImFontBaked upstream, not yet surfaced in the Java binding -- follow-up). Methods FindGlyph, FindGlyphNoFallback, GetCharAdvance were similarly moved. Kept: IsLoaded, GetDebugName, CalcTextSizeA, RenderChar, RenderText (last param is now `int flags` rather than `bool cpuFineClip`), plus new LegacySize and FallbackChar. - ImGui.PushFont(font) -> PushFont(font, size) -- size is now required; pass 0.0f to keep current size. - ImGui.Image(): removed tint_col and border_col params; use new ImageWithBg() for tinting, or ImGuiCol_ImageBorder for the border. - ImFontAtlas: dropped TexDesiredWidth (use TexMinWidth/TexMaxWidth on the C++ side -- not yet Java-surfaced). - ImFontConfig: GlyphExtraSpacing (ImVec2) -> GlyphExtraAdvanceX (float); FontBuilderFlags -> FontLoaderFlags. - ImGuiIO: removed PlatformLocaleDecimalPoint (moved to style.LocaleDecimalPoint); removed BackendUsingLegacyKeyArrays, BackendUsingLegacyNavInputArray. - ImGuiKey_KeysData_SIZE -> ImGuiKey_NamedKey_COUNT. - ImGuiStyle: TabMinWidthForCloseButton split into TabCloseButtonMinWidthSelected and TabCloseButtonMinWidthUnselected. - ImGuiChildFlags.Border -> ImGuiChildFlags.Borders (upstream rename in 1.91.1). - Flag enum: ImGuiFreeTypeBuilderFlags -> ImGuiFreeTypeLoaderFlags (upstream rename in 1.92). File renamed accordingly. - Internal: SetCurrentFont signature now takes (font, fontSizeBeforeScaling, fontSizeAfterScaling); UpdateHoveredWindowAndCaptureFlags now takes a mousePos; GetContentRegionMaxAbs was removed (compute manually). - LWJGL GLFW backend: replace ImGuiKey.ModCtrl/ModShift/ModAlt/ ModSuper with ImGuiKey.ImGuiMod_Ctrl etc. (upstream renamed ImGuiKey_ModCtrl -> ImGuiMod_Ctrl, the old names moved to ReservedForModCtrl). Build-side: - imgui-node-editor has an unreleased upstream fix pending for imgui 1.92's new operator*(float, ImVec2). A 3-line patch is included under patches/ and applied automatically at build time via a new applyVendorPatches gradle task, wired as a dependency of generateLibs. Idempotent. The patch can be removed once node-editor upstream ships a 1.92 compat release. Not done in this PR (reserved for follow-ups): - ImFontBaked wrapper for per-size glyph/metric access. - ImTextureRef Java wrapper type. Today Java passes texture handles as `long`; imgui's backward-compat implicit conversion from ImTextureID -> ImTextureRef makes this work, but surfacing the new type would let callers use dynamic textures. - Surfacing new APIs: TextLink/TextLinkOpenURL, Multi-Select, NextMarker variants, ImageWithBg overloads, etc. All the flag enums are AST-driven so they're already available. - ImGui 1.92 multi-select API (BeginMultiSelect / EndMultiSelect and ~13 new flags) and new widgets (TextLink / TextLinkOpenURL) are not yet surfaced in the Java binding. Verified: :imgui-binding:generateApi + generateLibs + :example:run on JDK 26 + macOS arm64 with the existing ImPlot demo rendering correctly through the LWJGL3 GLFW/OpenGL backend. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(api): surface new ImGuiStyle fields (FontScaleMain/Dpi, SeparatorSize) Follow-on to the 1.92 bump: expose three new ImGuiStyle fields added by imgui 1.92/1.92.7: - FontScaleMain: main global scale factor (replaces io.FontGlobalScale). - FontScaleDpi: DPI-driven global scale factor. - SeparatorSize: thickness of the Separator() line. Pure additions; no existing API changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(api): add TextLink, TextLinkOpenURL, GlyphExcludeRanges (imgui 1.91/1.92) Additive surface work layered on top of the imgui 1.92 bump: - ImGui.TextLink(label) -> boolean: inline hyperlink widget (imgui 1.91), returns true when clicked. Style via ImGuiCol_TextLink. - ImGui.TextLinkOpenURL(label, url): hyperlink that opens the given URL on click via io.PlatformOpenInShellFn. Uses OS defaults on Windows/Linux/macOS. - ImFontConfig.GlyphExcludeRanges: exclude Unicode ranges from a font source when merging multiple fonts (new in imgui 1.92); mirrors the existing GlyphRanges setter pattern. Demo: Main.java gains two inline examples -- an "increment" TextLink next to the counter, and a "Dear ImGui on GitHub" TextLinkOpenURL line below the slider. Backend fix: ImGuiImplGlfw.shutdown() now null-guards the cursor destroy loop. Since imgui 1.91 added ImGuiMouseCursor_Wait and _Progress slots that GLFW has no standard cursor for, those array entries stay zero-initialized. Upstream C code passes NULL to glfwDestroyCursor fine; LWJGL's Java wrapper asserts non-null and crashes on shutdown. This was blocking clean app exit with imgui 1.92. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(api): expose more 1.91/1.92 additions (io config, style fields, items, atlas) Batch of cheap, additive surface additions to round out imgui 1.91/1.92 coverage. No breaking changes. ImGuiIO: - ConfigDpiScaleFonts, ConfigDpiScaleViewports (docking branch DPI auto-scale, 1.92) - ConfigErrorRecovery + EnableAssert/EnableDebugLog/EnableTooltip (1.91.6) - ConfigDebugHighlightIdConflicts (1.91.0) ImGuiStyle: - ImageRounding, ImageBorderSize (1.92; rounded image calls) - TreeLinesFlags, TreeLinesSize, TreeLinesRounding (1.92; tree node hierarchy connector lines) - ColorMarkerSize (1.92.7; R/G/B/A color markers in ColorEdit4) ImGui: - GetItemFlags(): returns generic ImGuiItemFlags of last item (1.91) - IsItemToggledSelection(): per-item multi-select toggle query (1.91) - SetNextItemSelectionUserData(long): opaque 64-bit selection id for Multi-Select (1.91) -- foundational for the full Multi-Select API which is deferred to its own PR ImFontAtlas: - AddFontDefaultVector(): embedded scalable ProggyForever font (1.92) - AddFontDefaultBitmap(): embedded pixel-clean bitmap font (1.92) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(api): expose io.ConfigDockingNoDockingOver (imgui 1.92) One small docking-branch field added in 1.92 that we'd missed: if set, docking is limited to splitting windows only (no merging into the same tab-bar). Complements the existing ConfigDockingNoSplit. Scalar bool. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(api): surface ImFontAtlas TexMinWidth/MaxWidth/MaxHeight (imgui 1.92) Four new atlas dimension fields introduced in imgui 1.92 as the replacement for the removed TexDesiredWidth: - TexMinWidth (default 512) - TexMinHeight (default 128) - TexMaxWidth (default 8192) - TexMaxHeight (default 8192) These matter for legacy backends that don't report ImGuiBackendFlags_RendererHasTextures -- the 8192x8192 default cap is not enough when loading large glyph sets (e.g. full CJK_UNIFIED_IDEOGRAPHS at 14+12pt) and triggers 'Out of texture memory' assertions during the first-frame atlas build. Callers can now set e.g. atlas.setTexMaxWidth(16384); atlas.setTexMaxHeight(16384); before adding fonts. Discovered while porting a downstream app with extensive CJK glyphs to the 1.92 binding. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(docs): javadoc errors from 1.92 header comments and stale {@link} Strict doclint on JDK 17 rejects three patterns carried over verbatim from Dear ImGui 1.92 headers into Java Javadoc, producing hard errors that fail the CI `Build Java` step: 1. ImFont.java (LegacySize field): `{@link ImGui#pushFont(ImFont)}` — 1.92 replaced the 1-arg overload with `pushFont(ImFont, float)`, so the reference no longer resolves. Updated link to match new signature. 2. ImGui.java (TableGetHoveredColumn): bare `&` in `(TableGetColumnFlags() & ImGuiTableColumnFlags_IsHovered)` — wrapped the expression in `{@code ...}`. 3. ImGui.java (mouse-dragging family): bare `<` in `(uses io.MouseDraggingThreshold if lock_threshold < 0.0f)` — wrapped in `{@code ...}`. Covers 14 occurrences across Is/Get/Reset Mouse Dragging overloads. 4. ImGuiChildFlags.java: `"Demo->Child->Auto-resize with Constraints"` — wrapped menu path in `{@code ...}` (matches the treatment applied in the 1.90.9 bump commit 634e28b). Fixed both the hand-written source files under src/main and the committed generated mirrors under src/generated so a subsequent generateApi run won't undo the fixes. Verified locally with `javadoc -Xdoclint:all` over the full source+generated tree: 0 errors, 100 warnings (same shape as main's pre-1.92 baseline). * fix(api): populate ImGuiFreeTypeLoaderFlags (was empty after 1.92 rename) The @BindingAstEnum annotation on the source file used qualType = "ImGuiFreeTypeLoaderFlags" (no trailing underscore). In imgui 1.92 the actual enum in misc/freetype/imgui_freetype.h is named ImGuiFreeTypeLoaderFlags_; the unsuffixed ImGuiFreeTypeLoaderFlags is only a typedef for unsigned int. All other flag classes in the binding use the _-suffixed form (ImGuiCol_, ImGuiTableRowFlags_, ...). As a result the AST-driven generator found no matching enum members and emitted an empty class, breaking any caller that needs the hinting / styling / color / bitmap flags. Regenerated mirror under src/generated now exposes the 10 flags (NoHinting, NoAutoHint, ForceAutoHint, LightHinting, MonoHinting, Bold, Oblique, Monochrome, LoadColor, Bitmap) plus the ImGuiFreeTypeBuilderFlags_* obsolete aliases upstream keeps under #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS. The aliases don't strip because their prefix doesn't match sanitizeName -- this mirrors the existing pattern for other flag classes carrying similar compat entries (ImGuiCol.TabActive, ImGuiDockNodeFlags.NoSplit, etc.). Reported by SpaiR on the 1.92 bump PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(natives): update font-loader API surface for imgui 1.92 imgui 1.92 replaced ImFontBuilderIO with ImFontLoader and renamed the public entry points: ImGuiFreeType::GetBuilderForFreeType() -> GetFontLoader() ImFontAtlasGetBuilderForStbTruetype() -> ImFontAtlasGetFontLoaderForStbTruetype() atlas->FontBuilderIO = X -> atlas->SetFontLoader(X) Three places in this binding hard-coded the old names; the CI's Build Native step surfaced all of them once #383 unblocked it. GenerateLibs.groovy: the stb_truetype-default hack rewrites the body of imgui_draw.cpp after vendoring. The replacement pair is refreshed to the 1.92 names so the rewrite still finds its anchor. Previously it failed with: Unable to replace [imgui_draw.cpp] with content [ImFontAtlasGetBuilderForStbTruetype()]! ImFontAtlas.setFreeTypeRenderer: the JNI body used the removed FontBuilderIO field. Rewritten to the new SetFontLoader() API. Since ImFontAtlasGetFontLoaderForStbTruetype is declared only in imgui_internal.h (which the JNI translation unit doesn't pull in), the function is locally forward-declared as extern inside the method body rather than dragging imgui_internal.h file-wide. Verified: ./gradlew :imgui-binding:generateLibs on JDK 25 / macOS arm64 produces a working libimgui-java64.dylib. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 35f3c75 commit 32f4c23

66 files changed

Lines changed: 20363 additions & 11811 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,13 @@ If using Java 9 modules, ImGui Java has Automatic Module Names:
316316
All extensions are already included in the binding and can be used as it is.
317317
See examples in the `example` module for more information about how to use them.
318318

319-
- [ImNodes](https://github.com/Nelarius/imnodes/tree/857cc860af05ac0f6a4039c2af33d982377b6cf4) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImNodes.java) <br>
319+
- [ImNodes](https://github.com/Nelarius/imnodes/tree/b2ec254ce576ac3d42dfb7aef61deadbff8e7211) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImNodes.java) <br>
320320
A small, dependency-free node editor for Dear ImGui. (A good choice for simple start.)
321-
- [imgui-node-editor](https://github.com/thedmd/imgui-node-editor/tree/687a72f940c76cf5064e13fe55fa0408c18fcbe4) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImGuiNodeEditor.java) <br>
321+
- [imgui-node-editor](https://github.com/thedmd/imgui-node-editor/tree/021aa0ea4da13fed864bafb2a92d4c5205076866) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImGuiNodeEditor.java) <br>
322322
Node Editor using ImGui. (A bit more complex than ImNodes, but has more features.)
323323
- [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo/tree/f7bbbe39971d9d45816417a70e9b53a0f698c56e) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImGuizmo.java) <br>
324324
Immediate mode 3D gizmo for scene editing and other controls based on Dear ImGui.
325-
- [implot](https://github.com/epezent/implot/tree/555ff688a8134bc0c602123149abe9c17d577475) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImPlot.java) <br>
325+
- [implot](https://github.com/epezent/implot/tree/v0.17) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImPlot.java) <br>
326326
Advanced 2D Plotting for Dear ImGui.
327327
- [ImGuiColorTextEdit](https://github.com/BalazsJako/ImGuiColorTextEdit/tree/0a88824f7de8d0bd11d8419066caa7d3469395c4) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImGuiColorTextEdit.java) <br>
328328
Syntax highlighting text editor for ImGui.

build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@ tasks.register('generateAst', GenerateAst) {
8080
file('include/ImGuiColorTextEdit/TextEditor.h'),
8181
]
8282
}
83+
84+
// imgui-node-editor has an unreleased fix pending for imgui 1.92's new
85+
// 'operator*(float, ImVec2)'. Apply a small patch file to the vendored
86+
// submodule before native compile. The script is idempotent.
87+
tasks.register('applyVendorPatches', Exec) {
88+
group = 'build'
89+
description = 'Apply patches to vendored submodules (e.g. imgui-node-editor imgui 1.92 compat).'
90+
commandLine 'bash', 'buildSrc/scripts/apply_vendor_patches.sh'
91+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
# Apply patches to vendored submodules.
3+
# Idempotent: each patch is applied only if not already applied.
4+
5+
set -e
6+
7+
BASEDIR=$(dirname "$0")
8+
cd "$BASEDIR"/../.. || exit 1
9+
10+
apply_patch_idempotent() {
11+
local patch_file="$1"
12+
local target_dir="$2"
13+
14+
# --check returns 0 if the patch can apply cleanly (i.e. not yet applied),
15+
# non-zero if it can't (already applied, or conflicts).
16+
if git -C "$target_dir" apply --check "$patch_file" 2>/dev/null; then
17+
echo "Applying $patch_file to $target_dir"
18+
git -C "$target_dir" apply "$patch_file"
19+
else
20+
# Try reverse-check: if the patch is already applied, reversing would succeed.
21+
if git -C "$target_dir" apply --reverse --check "$patch_file" 2>/dev/null; then
22+
echo "Patch $patch_file already applied to $target_dir, skipping"
23+
else
24+
echo "ERROR: Patch $patch_file neither applies cleanly nor is already applied to $target_dir" >&2
25+
exit 1
26+
fi
27+
fi
28+
}
29+
30+
apply_patch_idempotent \
31+
"$(pwd)/patches/imgui-node-editor-imgui-1.92-operator-star.patch" \
32+
include/imgui-node-editor

buildSrc/src/main/groovy/tool/generator/GenerateLibs.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class GenerateLibs extends DefaultTask {
9393
// By defining IMGUI_ENABLE_FREETYPE, Dear ImGui will default to using the FreeType font renderer.
9494
// However, we modify the source code to ensure that, even with this, the STB_TrueType renderer is used instead.
9595
// To use the FreeType font renderer, it must be explicitly forced on the atlas manually.
96-
replaceSourceFileContent("imgui_draw.cpp", "ImGuiFreeType::GetBuilderForFreeType()", "ImFontAtlasGetBuilderForStbTruetype()")
96+
replaceSourceFileContent("imgui_draw.cpp", "ImGuiFreeType::GetFontLoader()", "ImFontAtlasGetFontLoaderForStbTruetype()")
9797
}
9898

9999
// Copy dirent for ImGuiFileDialog

0 commit comments

Comments
 (0)