Skip to content
StArraySharpPublic

About

imgui for .net

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ImGui4NET

English | 简体中文

Bare-metal .NET bindings for Dear ImGui, tracking v1.93.0-docking.

The bindings expose the native C++ API directly: structs are unsafe value types with the exact native layout, and every function is a [DllImport] with the mangled entry point. There is no wrapper layer and no allocation on the interop boundary.

Getting started

dotnet add package ImGui4NET
dotnet add package ImGui4NET.Backend.Glfw       # platform backend
dotnet add package ImGui4NET.Backend.OpenGL3    # renderer backend

Native libraries for win-x64, linux-x64, osx-x64, osx-arm64 and android-arm64 ship inside the packages under runtimes/. Every package targets net10.0. The Direct3D and Win32 backends additionally ship a net10.0-windows build, which is what a Windows-targeted project resolves; the plain net10.0 asset keeps them usable from a project that is not Windows-specific. All packages are trim- and NativeAOT-compatible.

Packages

Package Contents
ImGui4NET Core Dear ImGui bindings plus the native imgui library
ImGui4NET.Club Pure C# ports of the ocornut/imgui_club extensions: Memory Editor, Multi-Context Compositor, Threaded Rendering (no native library)
ImGui4NET.Backend.OpenGL2 OpenGL2 renderer backend
ImGui4NET.Backend.OpenGL3 OpenGL3 renderer backend
ImGui4NET.Backend.DirectX9 Direct3D 9 renderer backend
ImGui4NET.Backend.DirectX11 Direct3D 11 renderer backend
ImGui4NET.Backend.DirectX12 Direct3D 12 renderer backend
ImGui4NET.Backend.Vulkan Vulkan renderer backend
ImGui4NET.Backend.Win32 Win32 platform backend
ImGui4NET.Backend.Glfw GLFW platform backend
ImGui4NET.Backend.Sdl2 SDL2 platform backend
ImGui4NET.Backend.Sdl3 SDL3 platform backend
ImGui4NET.Backend.SdlGpu3 SDL3 GPU renderer backend
ImGui4NET.Backend.Glut GLUT platform backend
ImGui4NET.Backend.Metal Metal renderer backend (macOS)
ImGui4NET.Backend.Metal4 Metal 4 renderer backend (macOS 26+, Apple Silicon)
ImGui4NET.Backend.OSX macOS/Cocoa platform backend
ImGui4NET.Backend.Allegro5 Allegro5 platform backend
ImGui4NET.Backend.Android Android platform backend (arm64)

Each backend package ships its own native library and depends only on the core package, so an application pulls in exactly the backends it uses.

Usage

using ImGui4NET;
using ImGui4NET.Backend.OpenGL3;

unsafe
{
    ImGuiContext* ctx = ImGui.CreateContext();
    ImGui.SetCurrentContext(ctx);
    ImGui_ImplOpenGL3.Init("#version 330");
}

Building from source

Requires the imgui and imgui_club submodules, bash, python3, the .NET SDK, and a C++17 compiler.

git submodule update --init --recursive
dotnet tool restore
./tools/fetch-deps.sh          # download Allegro/freeglut native libraries
./tools/generate.sh --native   # regenerate bindings and build desktop natives
dotnet build ImGui4NET.slnx

See docs/build.md for the full pipeline, platform-specific prerequisites, Android cross-compilation and troubleshooting.

Documentation

Sample

samples/ImGui4NET.Sample.OpenGL3 is a complete application: OpenTK window, custom-drawn dashboard, Microsoft YaHei for CJK text, the imgui_club Memory Editor, and PNG screenshot capture.

dotnet run --project samples/ImGui4NET.Sample.OpenGL3

License

MIT — see LICENSE.

Dear ImGui and imgui_club are MIT licensed by Omar Cornut. Third-party components (Silk.NET, freeglut, Allegro) are consumed as NuGet packages and keep their own licenses.

About

imgui for .net

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages