Debug Your Game in Real-Time with Dear ImGui | .NET Game Development
Andy and Stacey explain how Dear ImGui can speed up debugging for .NET games by building an in-game “debug layer” that shows live state and editor controls while the game is running.
Overview
What problem Dear ImGui solves for game debugging
- Traditional debugging (breakpoints, pausing execution) can be slow and disruptive for games.
- A debug layer lets developers inspect and tweak game state in real time while the game continues running.
What Dear ImGui is (and when to use it)
- Dear ImGui is an immediate mode UI library that’s well-suited for:
- In-game debug tooling
- Editor-like controls for designers and developers
- Rapid iteration on gameplay and simulation parameters
- It’s not intended for player-facing UI (menus/HUD) in most cases.
.NET options: bindings and renderers
The video covers the typical pieces needed to use ImGui in a .NET game:
- .NET bindings
- ImGui.NET
- Hexa.NET.ImGui
- A renderer integration for the engine/framework you’re using (example shown with MonoGame).
Building real-time tooling inside the game
Examples of debug-layer capabilities discussed/demonstrated:
- Displaying live game state without stopping execution
- Binding UI controls to game data
- Creating in-game editors
- Moving sprites
- Changing shading
- Pausing simulations
- Using built-in interactivity such as drag-and-drop
Debugging workflow examples
- Using debug layers to reproduce and investigate bugs faster
- Testing edge cases (e.g., walls, movement constraints, AI behavior)
- Adding gameplay debug features (e.g., kill/signal-style debug actions)
Beyond games: other ImGui-style apps
- A brief example of ImGui used outside game development (ImHex hex editor demo).
Links and resources
- Dear ImGui (official repo): https://github.com/ocornut/imgui
- Hexa.NET.ImGui bindings: https://github.com/HexaEngine/Hexa.NET.ImGui
- ImGui.NET bindings: https://github.com/ImGuiNET/ImGui.NET
- MonoGame: https://monogame.net
- Series playlist: https://aka.ms/Quest-to-Compile