Conversation
|
@phraktle Hi |
Suggested merge order: #383 (Gradle 9 + buildSrc K2 fix) → #384 (submodules) → #385 (imgui 1.92) → #382 (implot v1.0). Happy to rebase after each merge. I submitted #382 to work as a standalone update too, in case you want to release a v1.90 series with only the dependencies like ImPlot v1.0 refreshed. |
|
@phraktle I was wondering if you could tell me a bit about how you made those changes. I noticed Claude mentioned in your commits. I'm definitely not against using AI, just curious about your process. If you have a prompt you're using, perhaps we could discuss it and incorporate more frequent updates. (I use Claude too, so this could be really helpful!) |
Well, it was a series of interactive sessions, but the gist of it was that it should carefully review the changes in a specific upstream project (eg implot 1.0) and create a plan to bring the bindings up to date, making sure tests pass and we try running the demo app. Then of course we've had to correct some problems, got into dependency update rabbit holes, etc :) Also tested the local build with our application to see it working in the real world and use some new bindings. So not sure there's a one-shot prompt, but I can certainly try to submit some agent-specific instructions in a separate PR to add to the project based on the sessions I've had. This might make it easier to replicate the process in the future. |
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>
…rSize) 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>
….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>
…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>
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>
…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>
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).
…ame) 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>
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 SpaiR#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>
47c6660 to
7e5e823
Compare
|
I think we also need to address changes in that commit. They are required for the new fonts API. |
Well, my app with custom fonts was working fine without these, so I figured we can postpone some new missing bindings (such as these, multi-select, etc). But will take a look at these specifically. |
|
I'd suggest tackling this in a separate PR. I prototyped it; the plumbing works but font rendering is different which would need further investigation. imgui 1.92 keeps the legacy atlas path for backends without RendererHasTextures, so the binding is fully functional without it. |
|
@phraktle Appreciate your contributions! Before we push the next release, I want to do a quick round of testing to make sure the main features added in 1.91 and 1.92 are solid. Also, I need to get an update for the backend sorted. So, I'll aim to have the new release ready by the end of the week. |
Type of change