DearImGui 1.88.0
See the version list below for details.
dotnet add package DearImGui --version 1.88.0
NuGet\Install-Package DearImGui -Version 1.88.0
<PackageReference Include="DearImGui" Version="1.88.0" />
paket add DearImGui --version 1.88.0
#r "nuget: DearImGui, 1.88.0"
// Install DearImGui as a Cake Addin #addin nuget:?package=DearImGui&version=1.88.0 // Install DearImGui as a Cake Tool #tool nuget:?package=DearImGui&version=1.88.0
DearImGui
This is imgui and implot bindings for .NET, including a controller for OpenTK.
Features
- Original documentation, when present, is available through IntelliSense
- Friendly types when possible: Span<T>, vectors from System.Numerics
- Close to zero allocations, the garbage collector will be your best friend!
Getting started
Windows, AnyCPU, .NET 6.0, OpenGL 4.5:
You will also need Microsoft Visual C++ Redistributable latest supported downloads:
Should you need debug builds of native DLLs, you will find them in the Releases tab.
Getting started (development)
General notes
Unlike similar projects, this one is generated directly against sources.
The pros of this approach are, for instance:
- documentation (when there is) for pretty much every member out there
- default values for optional parameters, i.e. 'vanilla' imgui interface
In short, we can closely mimic the interfaces of the original projects.
But there are cons as well, for instance:
- the generated code is better but the generators are more complex
- DLL exports with decorated names as these differ in 32-bit VS 64-bit
The former was solved by spending quite some time polishing the generators.
The latter was solved using Roslyn, rewriting the entire output to be AnyCPU.
Cloning
The repository has submodules, don't forget to clone them in the process:
git clone --recurse-submodules https://github.com/aybe/DearImGui.git
Building
Restoring CppSharp from GitHub's NuGet registry requires a personal access token.
In order for the projects in Managed folder to build, there are implicit dependencies:
- projects in Generated folder shall be started at least once
- projects in Native folder shall be batch built at least once
These dependencies can be pre-built by invoking build.cmd $(Configuration)
.
Extending
It should be possible to support other libraries such as imguizmo and imnodes.
Take a look at how implot is generated and the shared code used by generators.
However, few things may prove to be challenging due to how CppSharp works.
When bindings are generated, there is a version history for easily diff'ing them.
Known issues
Generator can't write output file:
Occasionally, you may encounter a similiar exception while generating:
4>Unhandled exception. System.IO.IOException: The process cannot access the file 'C:\...\DearImGui\DearImGui.Generator\bin\Release\net6.0\imgui.cs' because it is being used by another process.
Something has outstanding handles on that file, try to generate again.
Credits
https://github.com/ocornut/imgui
https://github.com/epezent/implot
https://github.com/mono/CppSharp
https://github.com/opentk/opentk
https://github.com/dotnet/pinvoke
https://github.com/dotnet/roslyn
https://github.com/dotnet/sourcelink
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- CppSharp.Runtime (>= 1.0.33.49587)
- System.Numerics.Vectors (>= 4.5.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DearImGui:
Package | Downloads |
---|---|
DearImGui.OpenTK
imgui for .NET OpenTK controller |
|
DearImPlot
implot for .NET |
GitHub repositories
This package is not used by any popular GitHub repositories.