HelixToolkit.Nex.ImGui 1.2.0

dotnet add package HelixToolkit.Nex.ImGui --version 1.2.0
                    
NuGet\Install-Package HelixToolkit.Nex.ImGui -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HelixToolkit.Nex.ImGui" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HelixToolkit.Nex.ImGui" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="HelixToolkit.Nex.ImGui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HelixToolkit.Nex.ImGui --version 1.2.0
                    
#r "nuget: HelixToolkit.Nex.ImGui, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HelixToolkit.Nex.ImGui@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HelixToolkit.Nex.ImGui&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=HelixToolkit.Nex.ImGui&version=1.2.0
                    
Install as a Cake Tool
# HelixToolkit.Nex.ImGui

The `HelixToolkit.Nex.ImGui` package provides integration with the ImGui library, enabling developers to create rich, immediate-mode graphical user interfaces within the HelixToolkit.Nex 3D graphics engine. This package facilitates the rendering of ImGui elements using Vulkan, leveraging the HelixToolkit.Nex's rendering capabilities.

## Overview

`HelixToolkit.Nex.ImGui` serves as a bridge between the ImGui library and the HelixToolkit.Nex engine, allowing developers to render ImGui interfaces within their 3D applications. It manages the setup and rendering of ImGui contexts, including font management and shader compilation. The package is designed to work seamlessly with the HelixToolkit.Nex's rendering pipeline, utilizing its ECS architecture and render graph system.

## Key Types

| Type            | Description                                                                 |
|-----------------|-----------------------------------------------------------------------------|
| `ImGuiConfig`   | Configuration class for setting up ImGui, including font path and size.     |
| `ImGuiRenderer` | Main class responsible for rendering ImGui elements within the engine.      |

## Usage Examples

### Basic Setup

To use the `ImGuiRenderer`, you need to initialize it with a rendering context and configuration, then integrate it into your rendering loop.

```csharp
using HelixToolkit.Nex.ImGui;
using HelixToolkit.Nex.Graphics;

// Create an ImGui configuration
var config = new ImGuiConfig
{
    FontPath = "path/to/font.ttf",
    FontSizeInPixel = 18
};

// Initialize the ImGui renderer with a rendering context
var context = /* Obtain IContext from HelixToolkit.Nex */;
var imguiRenderer = new ImGuiRenderer(context, config);

// Initialize the renderer with the target format
imguiRenderer.Initialize(Format.RGBA_UN8);

// In your rendering loop
imguiRenderer.BeginFrame(new Vector2(windowWidth, windowHeight));

// ImGui commands go here
ImGuiNET.ImGui.Text("Hello, ImGui!");

imguiRenderer.EndFrame();

// Render ImGui
imguiRenderer.Render(commandBuffer, renderPass, framebuffer, dependencies);

Architecture Notes

  • Design Patterns: The ImGuiRenderer utilizes the IDisposable pattern to manage resources effectively, ensuring that Vulkan resources are properly released.
  • Dependencies: This package depends on the HelixToolkit.Nex.Graphics and HelixToolkit.Nex.Shaders packages for rendering and shader management.
  • Integration: The renderer is designed to fit into the HelixToolkit.Nex's ECS and render graph architecture, allowing for efficient and organized rendering of ImGui elements alongside other 3D content.

Recent Changes

  • Depth State Binding: The ImGuiRenderer now explicitly binds the DepthState.Disabled during rendering, ensuring depth testing is disabled for ImGui elements.
  • Debug Group Label: The ImGuiRenderer uses a static byte array for the debug group label, improving performance by avoiding repeated string allocations.
  • Platform Configurations: The project includes additional build configurations for Linux (LinuxDebug and LinuxRelease), enhancing cross-platform support.
Product 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 was computed.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.0 93 7/17/2026