C.ImGuiGLFW 1.0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package C.ImGuiGLFW --version 1.0.0.2
                    
NuGet\Install-Package C.ImGuiGLFW -Version 1.0.0.2
                    
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="C.ImGuiGLFW" Version="1.0.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="C.ImGuiGLFW" Version="1.0.0.2" />
                    
Directory.Packages.props
<PackageReference Include="C.ImGuiGLFW" />
                    
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 C.ImGuiGLFW --version 1.0.0.2
                    
#r "nuget: C.ImGuiGLFW, 1.0.0.2"
                    
#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 C.ImGuiGLFW@1.0.0.2
                    
#: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=C.ImGuiGLFW&version=1.0.0.2
                    
Install as a Cake Addin
#tool nuget:?package=C.ImGuiGLFW&version=1.0.0.2
                    
Install as a Cake Tool

About

C.ImGuiGLFW is a C# class library that simplifies the creation of ImGui-rendered windows. It uses OpenGL 4.6 core for rendering, GLFW for window management system, and Hexa.NET.ImGui for ImGui integration.

Usage

Get C.ImGuiGLFW from NuGet using a console command:

dotnet add package C.ImGuiGLFW

Or simply find it via NuGet package manager GUI.

Basic Setup

Initialize the ImGuiController in the Main() method of your program:

ImGuiController.Initialize("MyApplication", modules: Module.All);

The Initialize method has multiple overloads to accommodate different initialization scenarios:

// Basic initialization with default settings
ImGuiController.Initialize();

// Initialize with modules
ImGuiController.Initialize(modules: Module.All);

// Initialize with window title
ImGuiController.Initialize("MyApp");

// Initialize with title and modules
ImGuiController.Initialize("MyApp", Module.All);

// Initialize with title and dimensions
ImGuiController.Initialize("MyApp", 800, 600);

// Initialize with title, dimensions, and modules
ImGuiController.Initialize("MyApp", 800, 600, Module.All);

// Initialize with dimensions only
ImGuiController.Initialize(800, 600);

// Initialize with dimensions and modules
ImGuiController.Initialize(800, 600, Module.All);

// Initialize with dimensions and position
ImGuiController.Initialize(800, 600, new Vector2(100, 100));

// Initialize with dimensions, position, and modules
ImGuiController.Initialize(800, 600, new Vector2(100, 100), Module.Guizmo);

// Initialize with dimensions, position, and resizable flag
ImGuiController.Initialize(800, 600, new Vector2(100, 100), true);

// Initialize with dimensions, position, resizable flag, and modules
ImGuiController.Initialize(800, 600, new Vector2(100, 100), true, Module.Nodes, Module Plot);

// Initialize with dimensions and position coordinates
ImGuiController.Initialize(800, 600, 100, 100);

// Initialize with dimensions, position coordinates, and modules
ImGuiController.Initialize(800, 600, 100, 100, Module.Plot);

// Initialize with custom WindowSettings
ImGuiController.Initialize(windowSettings);

// Initialize with custom WindowSettings and modules
ImGuiController.Initialize(windowSettings, Module.All);

Parameters:

  • windowSettings: Custom window settings (optional, reads from file if null)
  • title: Window title
  • width/height: Window dimensions in pixels
  • position: Window position as Vector2 or separate X/Y coordinates
  • resizable: Whether the window should be resizable
  • modules: ImGui modules to initialize (optional params array)

Event Handling

Subscribe to various events to handle user input and UI rendering:

// Handle main menu bar rendering
ImGuiController.OnMainMenuBarRender += MainMenuBar;

// Handle character input events
ImGuiController.OnChar += OnCharInput;

Adding Windows

Create and add your custom ImGui windows:

var demoWindow = new DemoWindow();
ImGuiController.AddWindow(demoWindow);

Running the Application

Start the main application loop:

ImGuiController.Run();

Example

Here's a minimal example:

using System;
using C.ImGuiGLFW;

class Program
{
    static void Main()
    {
        // Initialize ImGuiController
        ImGuiController.Initialize("TESTWINDOW");
        
        // Set up event handlers
        ImGuiController.OnMainMenuBarRender += MainMenuBar;
        ImGuiController.OnChar += OnCharInput;
        
        // Create and add windows
        var demoWindow = new DemoWindow();
        ImGuiController.AddWindow(demoWindow);
        
        // Start the application
        ImGuiController.Run();
    }
    
    private static void MainMenuBar()
    {
        // Your main menu bar implementation
    }
    
    private static void OnCharInput(uint codepoint)
    {
        // Handle character input
    }
}

Creating Custom Windows

To create custom windows, implement the appropriate window interface or base class:

public class DemoWIndow : Window
{
    protected override void Draw()
    {
        ImGui.Text("Hello, World!");
    }
}

Available Modules

The Module enum allows you to specify which ImGui modules to initialize:

  • Module.All: Load all available modules
  • Module.Guizmo: ImGuizmo for 3D gizmo manipulation
  • Module.Nodes: ImNodes for node-based graph editing
  • Module.Plot: ImPlot for data plotting and visualization

Multiple modules can be specified:

// Load specific modules
ImGuiController.Initialize("MyApp", Module.Guizmo, Module.Plot);

// Load all modules (equivalent to Module.All)
ImGuiController.Initialize("MyApp", Module.Guizmo, Module.Nodes, Module.Plot);

Dependencies

This project depends on several NuGet packages. Run dotnet list package to see current versions, or check THIRD-PARTY-NOTICES for license details.

Product Compatible and additional computed target framework versions.
.NET 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 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.0.0.11 86 8/17/2025
1.0.0.10 86 8/17/2025
1.0.0.9 69 8/3/2025
1.0.0.8 97 8/1/2025
1.0.0.7 113 7/31/2025
1.0.0.6 97 7/28/2025
1.0.0.5 98 7/28/2025
1.0.0.4 93 7/28/2025
1.0.0.3 99 7/28/2025
1.0.0.2 95 7/28/2025
1.0.0.1 97 7/28/2025
1.0.0 110 7/27/2025