Home

Awesome

Dear ImGui-flavored Mochi

MIT Licensed CI Status NuGet Version Sponsor

This repo contains C# bindings for Dear ImGui as well as a Biohazrd-powered generator for generating them.

We currently publish NuGet packages for .NET 6 on Windows x64 and Linux x64 (glibc >= 2.27). The Mochi.DearImGui package currently only provides Windows support, it will be a cross-platform meta package in the future. Mochi.DearImGui.linux-x64 provides support for Linux.

A backend for OpenTK is published as Mochi.DearImGui.OpenTK, and is platform-independent. See Mochi.DearImGui.Sample for example usage.

In contrast to other C# bindings for Dear ImGui, this one interacts with the C++ API directly and is lower-level. If you need high-level bindings consider using the excellent ImGui.NET instead.

License

This project is licensed under the MIT License. See the license file for details.

Additionally, this project has some third-party dependencies. See the third-party notice listing for details.

Building

Windows Prerequisites

Windows 10 21H2 x64 is recommended.

ToolTested Version
Visual Studio2022 (17.1.0p2)
.NET 6.0 SDK6.0.101
CMake3.22.0

Visual Studio must have the "Desktop development with C++" workload installed.

Linux Prerequisites

Ubuntu 20.04 Focal x64 is recommended, but most distros are expected to work. (Mochi.DearImGui itself should also work on Linux ARM64, but the OpenTK backend doesn't since OpenTK's GLFW redistributable doesn't.)

PackageTested Version
build-essential12.8
cmake3.16.3
dotnet-sdk-6.06.0.100

Building Dear ImGui and generating the bindings

  1. Ensure Git submodules are up-to-date with git submodule update --init --recursive
  2. Build and run generate.cmd (Windows) or generate.sh (Linux) from the repository root

Building and running the sample

Without modification the sample will depend on the bindings being built locally as instructed above.

Simply build+run Mochi.DearImGui.Sample as you would any other .NET project. (IE: Using F5 in Visual Studio or dotnet run --project Mochi.DearImGui.Sample.)