Attempt #3 at making an ImGui backend for C# for simple, cross-platform UI creation.
Find a file
2025-11-17 15:38:16 -06:00
GimmeGui Initial commit 2025-11-17 14:58:09 -06:00
GimmeGui.Demo feat#: Add simple README with basic usage instructions 2025-11-17 15:33:12 -06:00
.gitignore Initial commit 2025-11-17 14:58:09 -06:00
GimmeGui.slnx Initial commit 2025-11-17 14:58:09 -06:00
LICENSE feat#: Add license 2025-11-17 15:32:11 -06:00
README.md tweak#: Update README with more complete library credits 2025-11-17 15:38:16 -06:00

GimmeGui - for when you need GUI now.

GimmeGui is a simple C# backend for Dear ImGui that makes it easy to quickly get set up and running with a functional UI.

Basic usage

Displaying a UI is a simple matter of calling GimmeGui.Now(Action<Window, Renderer>) and passing in your UI drawing function.

Below is a demo program showing how quickly you can create a window to render your GUI in:

using Hexa.NET.ImGui;
using System.Numerics;
using GimmeGuiLib;

namespace DemoProgram;

static class Program
{
    static bool _check;
    static string _input = "";
    static float _slider;
    static Vector4 _color = Vector4.One; // Initialize to white

    public static void Main(string[] args)
    {
        // Using an inline delegate for simplicity
        GimmeGui.Now((window, renderer) =>
        {
            /*
             * The u8 makes constant UTF8 strings to avoid
             * UTF16 -> UTF8 conversions each frame.
            */

            if (ImGui.Begin("Here's a window!"u8))
            {
                ImGui.SeparatorText("Here's a few test widgets just to show this works"u8);
                ImGui.Checkbox("Check this out!"u8, ref _check);
                ImGui.InputText("Type here"u8, ref _input, 1024);
                ImGui.SliderFloat("Slide me!"u8, ref _slider, 0f, 10f);
                ImGui.ColorEdit4("Color input!"u8, ref _color.X);

                // I find adding curly braces makes push/pop areas more visible.
                ImGui.PushStyleColor(ImGuiCol.Text, _color);
                {
                    ImGui.TextWrapped("Here's some text that'll be colored by the color picker widget"u8);
                }
                ImGui.PopStyleColor();
            }
            ImGui.End();

            if (_check)
                ImGui.ShowDemoWindow();
        });
    }
}

Currently the user-facing API is rather simplistic, but there is a more advanced example in the demo project if you want to get your hands dirty.

Libraries used