Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,13 @@ If using Java 9 modules, ImGui Java has Automatic Module Names:
All extensions are already included in the binding and can be used as it is.
See examples in the `example` module for more information about how to use them.

- [ImNodes](https://github.com/Nelarius/imnodes/tree/857cc860af05ac0f6a4039c2af33d982377b6cf4) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImNodes.java) <br>
- [ImNodes](https://github.com/Nelarius/imnodes/tree/b2ec254ce576ac3d42dfb7aef61deadbff8e7211) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImNodes.java) <br>
A small, dependency-free node editor for Dear ImGui. (A good choice for simple start.)
- [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>
- [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>
Node Editor using ImGui. (A bit more complex than ImNodes, but has more features.)
- [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo/tree/f7bbbe39971d9d45816417a70e9b53a0f698c56e) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImGuizmo.java) <br>
Immediate mode 3D gizmo for scene editing and other controls based on Dear ImGui.
- [implot](https://github.com/epezent/implot/tree/555ff688a8134bc0c602123149abe9c17d577475) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImPlot.java) <br>
- [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>
Advanced 2D Plotting for Dear ImGui.
- [ImGuiColorTextEdit](https://github.com/BalazsJako/ImGuiColorTextEdit/tree/0a88824f7de8d0bd11d8419066caa7d3469395c4) | [Example](https://github.com/SpaiR/imgui-java/blob/main/example/src/main/java/ExampleImGuiColorTextEdit.java) <br>
Syntax highlighting text editor for ImGui.
Expand Down
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,12 @@ tasks.register('generateAst', GenerateAst) {
file('include/ImGuiColorTextEdit/TextEditor.h'),
]
}

// imgui-node-editor has an unreleased fix pending for imgui 1.92's new
// 'operator*(float, ImVec2)'. Apply a small patch file to the vendored
// submodule before native compile. The script is idempotent.
tasks.register('applyVendorPatches', Exec) {
group = 'build'
description = 'Apply patches to vendored submodules (e.g. imgui-node-editor imgui 1.92 compat).'
commandLine 'bash', 'buildSrc/scripts/apply_vendor_patches.sh'
}
32 changes: 32 additions & 0 deletions buildSrc/scripts/apply_vendor_patches.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# Apply patches to vendored submodules.
# Idempotent: each patch is applied only if not already applied.

set -e

BASEDIR=$(dirname "$0")
cd "$BASEDIR"/../.. || exit 1

apply_patch_idempotent() {
local patch_file="$1"
local target_dir="$2"

# --check returns 0 if the patch can apply cleanly (i.e. not yet applied),
# non-zero if it can't (already applied, or conflicts).
if git -C "$target_dir" apply --check "$patch_file" 2>/dev/null; then
echo "Applying $patch_file to $target_dir"
git -C "$target_dir" apply "$patch_file"
else
# Try reverse-check: if the patch is already applied, reversing would succeed.
if git -C "$target_dir" apply --reverse --check "$patch_file" 2>/dev/null; then
echo "Patch $patch_file already applied to $target_dir, skipping"
else
echo "ERROR: Patch $patch_file neither applies cleanly nor is already applied to $target_dir" >&2
exit 1
fi
fi
}

apply_patch_idempotent \
"$(pwd)/patches/imgui-node-editor-imgui-1.92-operator-star.patch" \
include/imgui-node-editor
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class GenerateLibs extends DefaultTask {
// By defining IMGUI_ENABLE_FREETYPE, Dear ImGui will default to using the FreeType font renderer.
// However, we modify the source code to ensure that, even with this, the STB_TrueType renderer is used instead.
// To use the FreeType font renderer, it must be explicitly forced on the atlas manually.
replaceSourceFileContent("imgui_draw.cpp", "ImGuiFreeType::GetBuilderForFreeType()", "ImFontAtlasGetBuilderForStbTruetype()")
replaceSourceFileContent("imgui_draw.cpp", "ImGuiFreeType::GetFontLoader()", "ImFontAtlasGetFontLoaderForStbTruetype()")
}

// Copy dirent for ImGuiFileDialog
Expand Down
Loading
Loading