build(deps): bump Gradle wrapper to 9.4.1 and LWJGL to 3.4.1#383
Merged
SpaiR merged 4 commits intoSpaiR:mainfrom Apr 20, 2026
Merged
build(deps): bump Gradle wrapper to 9.4.1 and LWJGL to 3.4.1#383SpaiR merged 4 commits intoSpaiR:mainfrom
SpaiR merged 4 commits intoSpaiR:mainfrom
Conversation
….4.1 Gradle 9.x is required for local builds on JDK 25+ -- Gradle 8.14.3's bundled Kotlin fails to parse recent JDK version strings (IllegalArgumentException: 26). Gradle 9.4.1's Kotlin 2.x handles all current JDKs. LWJGL 3.4.1 is a minor bump with no binding-visible API breaks. Verified: binding compile, native generateLibs, and :example:run (with the existing ImPlot showcase) all green on JDK 26 + macOS arm64. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Paired with the Gradle 9.4.1 wrapper bump: make the root and
imgui-binding build scripts usable under Gradle 9's configuration
cache (the default for downstream consumers on Gradle 9+).
Three changes:
- build.gradle: replace Groovy 'git describe'.execute() with
providers.exec (cache-aware external process API). Same for
'git rev-parse HEAD' in the jar manifest block.
- imgui-binding/build.gradle: capture project.version.toString() into
a local at configuration time, and pass that through the
processResources filesMatching closure rather than letting the
closure resolve `version` against the live Project model at
execution time.
Without this, any downstream consumer running Gradle 9 with
configuration cache on (including `includeBuild` composite builds)
hits:
- Starting an external process 'git describe --tags --always' during
configuration time is unsupported.
- Invocation of 'version' references a Gradle script object from a
Groovy closure at execution time, which is unsupported with the
configuration cache.
Verified: `./gradlew :imgui-binding:compileJava --configuration-cache`
now stores a configuration cache entry cleanly on Gradle 9.4.1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Kotlin 2.x's K2 compiler emits a runtime CHECKCAST to java.lang.Void at generic call sites where the type argument is specified as Nothing. That checkcast was elided under K1, but K1 is gone in Kotlin 2.0. The codegen used `<Nothing>` extensively on Spoon's builder-style setters (setType, setSimpleName, setParent, addParameter, etc.) as a "don't care" type argument, since Nothing is the bottom type and therefore a subtype of every bound. Under K2 those calls throw ClassCastException because Spoon returns concrete CtMethodImpl etc., not Void. Replace each <Nothing> with the bound-appropriate type so no Void checkcast is emitted: setType -> CtTypedElement<Any> setSimpleName -> CtNamedElement (or CtReference on type refs) setParent -> CtElement setDocComment -> CtElement setAnnotations -> CtElement addAnnotation -> CtElement addModifier -> CtModifiable setModifiers -> CtModifiable addParameter -> CtMethod<Any> addParameterAt -> CtMethod<Any> setParameters -> CtMethod<Any> setBody -> CtBodyHolder addStatement -> CtStatementList setTags -> CtJavaDoc removeTag -> CtJavaDoc setValue -> CtCodeSnippet addValue -> CtAnnotation<Annotation> setAssignment -> CtRHSReceiver<Any> createMethod -> Any (unbounded) createField -> Any createParameter -> Any createTypeReference -> Any (or Annotation for createAnnotation chain) `method.clone()` sites cast to CtMethod<Any> with @Suppress because CtMethod<*>.setParameters<T : CtExecutable<captured *>> has no T that Kotlin can infer or accept.
Gradle 9's default checkstyle toolVersion (~10.21+) requires Java 11+ to run, but every module pinned a Java 8 toolchain, so Gradle routed the Checkstyle task's launcher through JDK 8 and the Ant task class (class file version 55) failed to load on the JDK 8 runtime. Rather than pin an old checkstyle or splice a separate launcher just for Checkstyle, bump the build toolchain to JDK 17 in every module and set `options.release = 8` on the library modules. Net effect: - compile/checkstyle/javadoc all run on the same modern JVM - published jars still contain class file version 52 (Java 8) — the library's consumer baseline is unchanged (verified on ImGui.class) - CI only needs to install JDK 17 (dropped the dual 8+17 setup) Also bump foojay-resolver-convention 0.10.0 -> 1.0.0. Gradle 9 removed JvmVendorSpec.IBM_SEMERU; the 0.10.0 plugin references it in its <clinit>, so any local build that has to download a toolchain (no matching JDK already installed) crashes with NoSuchFieldError before reaching the task graph. CI didn't hit this because setup-java pre-installs the JDKs. Verified: ./gradlew buildAll green on JDK 25 / macOS arm64; javap on the produced ImGui.class reports major version 52. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
phraktle
added a commit
to phraktle/imgui-java
that referenced
this pull request
Apr 20, 2026
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>
SpaiR
pushed a commit
that referenced
this pull request
Apr 21, 2026
* 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>
2 tasks
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.
Type of change