ImKit.MonoGame
0.0.1
dotnet add package ImKit.MonoGame --version 0.0.1
NuGet\Install-Package ImKit.MonoGame -Version 0.0.1
<PackageReference Include="ImKit.MonoGame" Version="0.0.1" />
<PackageVersion Include="ImKit.MonoGame" Version="0.0.1" />
<PackageReference Include="ImKit.MonoGame" />
paket add ImKit.MonoGame --version 0.0.1
#r "nuget: ImKit.MonoGame, 0.0.1"
#:package ImKit.MonoGame@0.0.1
#addin nuget:?package=ImKit.MonoGame&version=0.0.1
#tool nuget:?package=ImKit.MonoGame&version=0.0.1
ImKit.MonoGame
MonoGame backend for ImKit: a Dear ImGui
renderer for MonoGame/FNA, texture binding, and dependency-injection wiring.
Install
dotnet add package ImKit.MonoGame
Targets net10.0. Brings in ImKit, ImGui.NET and
MonoGame.Framework.DesktopGL.
Wiring it up
services.AddImKit(
graphicsDeviceFactory: sp => sp.GetRequiredService<MyGame>().GraphicsDevice,
gameWindowFactory: sp => sp.GetRequiredService<MyGame>().Window);
services.AddDockSpace<EditorDockSpace>();
services.AddGuiWidget<MainMenuWidget>();
services.AddGuiWidget<InspectorWidget>();
The graphics device and window are passed as factories because neither exists until
Game.Initialize has run — usually after the container is built. They are resolved
lazily, on first use of the renderer.
AddGuiWidget<T> registers one instance under both T and IGuiWidget, so a widget can
also be injected by its concrete type (or resolved as an event subscriber) without a
second instance being constructed.
Then drive it from Game:
protected override void Initialize()
{
base.Initialize();
_gui.Initialize(); // uploads the font atlas
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.Black);
_gui.Draw(gameTime.ToFrameTime());
}
ToFrameTime() converts MonoGame's GameTime to ImKit's backend-agnostic
FrameTime.
Renderer
ImGuiRenderer implements IImGuiRenderer, which is ImKit's IGuiBackend plus
texture binding:
IntPtr id = renderer.BindTexture(texture);
ImGui.Image(id, new Vector2(texture.Width, texture.Height));
// ...
renderer.UnbindTexture(id); // does not dispose the texture
Every bound handle must be released, otherwise the renderer keeps the texture alive.
The constructor creates the ImGui context and enables docking, so construct exactly one per application. Manual construction without a container:
var renderer = new ImGuiRenderer(
new GraphicsDeviceWrapper(GraphicsDevice),
new GameWindowWrapper(Window));
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- ImKit (>= 0.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- MonoGame.Framework.DesktopGL (>= 3.8.5)
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.0.1 | 102 | 9/26/2026 |