ktsu.ImGuiProvider
1.1.23
Prefix Reserved
dotnet add package ktsu.ImGuiProvider --version 1.1.23
NuGet\Install-Package ktsu.ImGuiProvider -Version 1.1.23
<PackageReference Include="ktsu.ImGuiProvider" Version="1.1.23" />
<PackageVersion Include="ktsu.ImGuiProvider" Version="1.1.23" />
<PackageReference Include="ktsu.ImGuiProvider" />
paket add ktsu.ImGuiProvider --version 1.1.23
#r "nuget: ktsu.ImGuiProvider, 1.1.23"
#:package ktsu.ImGuiProvider@1.1.23
#addin nuget:?package=ktsu.ImGuiProvider&version=1.1.23
#tool nuget:?package=ktsu.ImGuiProvider&version=1.1.23
ImGuiProvider
A dependency injection abstraction layer over ImGui implementations for .NET, providing clean interfaces and swappable backends.
Features
- Dependency Injection - Clean integration with
Microsoft.Extensions.DependencyInjection - Provider Abstraction -
IImGuiProviderinterface wrapping 160+ ImGui methods allows swapping implementations - Backend Support - Separate
IPlatformBackendandIRendererBackendinterfaces for windowing and rendering - Context Management -
ImGuiContexthandles the full frame lifecycle (initialize, begin frame, end frame, dispose) - Built-in Implementation - Ships with
HexaNetImGuiProviderwrapping Hexa.NET.ImGui
Installation
dotnet add package ktsu.ImGuiProvider
Quick Start
using ImGuiProvider.Extensions;
using ImGuiProvider.Services;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddImGui(); // Registers HexaNetImGuiProvider as singleton
var serviceProvider = services.BuildServiceProvider();
var context = serviceProvider.GetRequiredService<ImGuiContext>();
Usage with Backends
var services = new ServiceCollection();
services.AddImGui();
services.AddImGuiBackend<MyPlatformBackend>();
services.AddImGuiBackend<MyRendererBackend>();
var serviceProvider = services.BuildServiceProvider();
var context = serviceProvider.GetRequiredService<ImGuiContext>();
// Resolve and attach backends
var platformBackend = serviceProvider.GetRequiredService<IPlatformBackend>();
var rendererBackend = serviceProvider.GetRequiredService<IRendererBackend>();
context.Initialize();
context.AddBackend(platformBackend);
context.AddBackend(rendererBackend);
context.InitializeBackends();
// Render loop
while (running)
{
context.BeginFrame();
// Your ImGui code here
var provider = serviceProvider.GetRequiredService<IImGuiProvider>();
provider.ShowDemoWindow();
context.EndFrame();
}
context.Dispose();
Core Interfaces
IImGuiProvider
The main abstraction over ImGui functionality:
public interface IImGuiProvider : IDisposable
{
nint CreateContext();
void SetCurrentContext(nint context);
nint GetCurrentContext();
void DestroyContext(nint context);
void NewFrame();
void EndFrame();
void Render();
nint GetDrawData();
bool Begin(string name);
void End();
void Text(string text);
bool Button(string label);
void ShowDemoWindow();
// ... 160+ methods covering the full ImGui API
}
IImGuiBackend
Base interface for all backends:
public interface IImGuiBackend : IDisposable
{
string Name { get; }
bool Initialize();
void Shutdown();
void NewFrame();
void RenderDrawData(nint drawData);
void SetCurrentContext(nint context);
}
IPlatformBackend and IRendererBackend
Specialized backend interfaces:
public interface IPlatformBackend : IImGuiBackend
{
void ProcessEvents();
}
public interface IRendererBackend : IImGuiBackend
{
bool CreateDeviceObjects();
void InvalidateDeviceObjects();
}
Custom Implementations
Custom Provider
public class MyProvider : IImGuiProvider
{
// Implement all IImGuiProvider methods
}
services.AddImGui<MyProvider>();
// Or with a factory:
services.AddImGui(sp => new MyProvider());
Custom Backend
public class MyBackend : IRendererBackend
{
public string Name => "My Backend";
public bool Initialize() => true;
public void Shutdown() { }
public void NewFrame() { }
public void RenderDrawData(nint drawData) { }
public void SetCurrentContext(nint context) { }
public bool CreateDeviceObjects() => true;
public void InvalidateDeviceObjects() { }
public void Dispose() { }
}
services.AddImGuiBackend<MyBackend>();
Requirements
- .NET 8.0, 9.0, or 10.0
- Hexa.NET.ImGui 2.2.8.4
- Microsoft.Extensions.DependencyInjection.Abstractions 9.0.7
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Hexa.NET.ImGui (>= 2.2.9)
- Microsoft.Extensions.DependencyInjection (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
-
net8.0
- Hexa.NET.ImGui (>= 2.2.9)
- Microsoft.Extensions.DependencyInjection (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
-
net9.0
- Hexa.NET.ImGui (>= 2.2.9)
- Microsoft.Extensions.DependencyInjection (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
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 |
|---|---|---|
| 1.1.23 | 0 | 8/26/2026 |
| 1.1.22 | 0 | 8/25/2026 |
| 1.1.21 | 60 | 8/21/2026 |
| 1.1.20 | 63 | 8/20/2026 |
| 1.1.19 | 64 | 8/19/2026 |
| 1.1.18 | 72 | 8/19/2026 |
| 1.1.17 | 84 | 8/18/2026 |
| 1.1.16 | 96 | 8/17/2026 |
| 1.1.15 | 93 | 8/11/2026 |
| 1.1.14 | 89 | 8/11/2026 |
| 1.1.13 | 84 | 8/6/2026 |
| 1.1.12 | 91 | 8/6/2026 |
| 1.1.11 | 89 | 8/5/2026 |
| 1.1.10 | 106 | 7/28/2026 |
| 1.1.9 | 102 | 7/21/2026 |
| 1.1.8 | 108 | 7/15/2026 |
| 1.1.7 | 103 | 7/14/2026 |
| 1.1.6 | 110 | 7/13/2026 |
| 1.1.5 | 134 | 7/9/2026 |
| 1.1.4 | 106 | 7/1/2026 |
## v1.1.23 (patch)
Changes since v1.1.22:
- ci: make the SonarQube quality gate opt in [patch] ([@matt-edmondson](https://github.com/matt-edmondson))
- ci: adopt the unified dotnet workflow [patch] ([@matt-edmondson](https://github.com/matt-edmondson))