DearImPlot 0.14.0.1
dotnet add package DearImPlot --version 0.14.0.1
NuGet\Install-Package DearImPlot -Version 0.14.0.1
<PackageReference Include="DearImPlot" Version="0.14.0.1" />
paket add DearImPlot --version 0.14.0.1
#r "nuget: DearImPlot, 0.14.0.1"
// Install DearImPlot as a Cake Addin #addin nuget:?package=DearImPlot&version=0.14.0.1 // Install DearImPlot as a Cake Tool #tool nuget:?package=DearImPlot&version=0.14.0.1
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 dearimgui-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)
- DearImGui (>= 1.88.0.1)
- System.Numerics.Vectors (>= 4.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.14.0.1 | 564 | 1/14/2023 |