ImGui.NET.4Unity is a maintained ImGui.NET fork focused on Unity integration scenarios.
It provides .NET bindings for:
- Dear ImGui via cimgui
- ImPlot (
cimplot) - ImNodes (
cimnodes) - ImGuizmo (
cimguizmo) - Additional native variants used by this fork (
cimplot3d,cimnodes_r,cimguizmo_quat,cimCTE)
This repository is used to keep native/runtime bindings updated and then propagate those updates to:
In short: this is the update workspace used to bring newer ImGui ecosystem native libs and generated bindings into psydack/uimgui.
Most of the API surface is generated from native definition JSON files.
- Native binaries are stored under
deps/<lib>/<rid>/ - Native API JSON definitions are stored under
src/CodeGenerator/definitions/<lib>/ - Generated C# bindings are emitted into each project
Generated/folder
Projects in src/:
ImGui.NETImPlot.NETImNodes.NETImGuizmo.NETCodeGenerator- Sample programs
PowerShell:
./download-native-deps.ps1
./download-native-deps.ps1 -tag <release-tag>Bash:
./download-native-deps.sh
./download-native-deps.sh <release-tag>By default, scripts download from:
https://github.com/psydack/ImGui.NET-nativebuild
They refresh:
- Native binaries in
deps/ definitions.json,structs_and_enums.json, andvariants.jsoninsrc/CodeGenerator/definitions/
Build and run the generator after updating native dependencies:
dotnet restore src
dotnet build src
# ImGui
bin/Release/CodeGenerator/net8.0/CodeGenerator.exe "src/ImGui.NET/Generated"
# ImPlot
bin/Release/CodeGenerator/net8.0/CodeGenerator.exe "src/ImPlot.NET/Generated" cimplot
# ImNodes
bin/Release/CodeGenerator/net8.0/CodeGenerator.exe "src/ImNodes.NET/Generated" cimnodes
# ImGuizmo
bin/Release/CodeGenerator/net8.0/CodeGenerator.exe "src/ImGuizmo.NET/Generated" cimguizmo
# ImPlot3D
bin/Release/CodeGenerator/net8.0/CodeGenerator.exe "src/ImPlot3D.NET/Generated" cimplot3d
# ImNodesR
bin/Release/CodeGenerator/net8.0/CodeGenerator.exe "src/ImNodesR.NET/Generated" cimnodes_r
# ImGuizmoQuat
bin/Release/CodeGenerator/net8.0/CodeGenerator.exe "src/ImGuizmoQuat.NET/Generated" cimguizmo_quat
# CimCTE
bin/Release/CodeGenerator/net8.0/CodeGenerator.exe "src/CimCTE.NET/Generated" cimCTEImGuiIOPtr io = ImGui.GetIO();
IntPtr freeTypeLoader = ImGui.GetFontLoader();
if (freeTypeLoader != IntPtr.Zero)
{
io.Fonts.SetFontLoader(freeTypeLoader);
io.Fonts.FontLoaderFlags = (uint)ImGuiFreeTypeLoaderFlags.LightHinting;
}ImGuiIOPtr io = ImGui.GetIO();
io.ConfigErrorRecoveryEnableAssert = true;With native builds compiled with custom_assert, assertion failures are routed by the native assert hook.
// Example at native build integration layer:
// #define IM_ASSERT(_EXPR) CustomAssert((_EXPR), #_EXPR, __FILE__, __LINE__)dotnet restore src
dotnet build srcImGui.NET currently targets:
netstandard2.0net6.0net8.0
Generated/*.gen.csfiles are generated artifacts and should not be edited manually.- Manual wrapper behavior should be changed in
*.Manual.csfiles.