ScriptsApr 15, 2026·3 min read

Dear ImGui — Bloat-Free Immediate Mode GUI for C++ That Powers Every Game Tool

Dear ImGui is the immediate-mode GUI library used by virtually every game engine for in-game editors, debug overlays, and tooling. Minimal dependencies, minimal state, maximum productivity.

TL;DR
Dear ImGui powers in-game editors and debug tools across virtually every game engine.
§01

What it is

Dear ImGui is an immediate-mode GUI library for C++ used by virtually every game engine for in-game editors, debug overlays, profiling tools, and level editors. Unlike retained-mode GUI frameworks, ImGui redraws the entire interface each frame with minimal state management. This makes it trivial to add debug UI to any application with a render loop.

This tool is for game developers, engine programmers, and anyone building C++ applications with real-time rendering who needs quick, functional UI without the weight of full GUI frameworks.

§02

How it saves time or tokens

Dear ImGui requires almost no setup. Include the headers, call a few functions in your render loop, and you have windows, sliders, buttons, color pickers, and plots. There is no layout engine to learn, no style system to configure, and no event loop to manage. The immediate-mode paradigm means UI code reads linearly: if a button is clicked, the code right after the button call handles it.

§03

How to use

  1. Add ImGui source files to your project (no build system required).
  2. Initialize with your rendering backend.
  3. Call ImGui functions in your render loop.
  4. The UI appears immediately.
// Minimal setup in your render loop
#include "imgui.h"

void renderFrame() {
    ImGui::NewFrame();

    // Create a window with controls
    ImGui::Begin("Debug Panel");
    ImGui::Text("FPS: %.1f", ImGui::GetIO().Framerate);

    static float speed = 1.0f;
    ImGui::SliderFloat("Speed", &speed, 0.0f, 10.0f);

    static bool wireframe = false;
    ImGui::Checkbox("Wireframe", &wireframe);

    if (ImGui::Button("Reset")) {
        speed = 1.0f;
        wireframe = false;
    }
    ImGui::End();

    ImGui::Render();
}
§04

Example

A property editor for a game object:

void drawObjectInspector(GameObject& obj) {
    ImGui::Begin("Inspector");

    ImGui::InputText("Name", obj.name, sizeof(obj.name));
    ImGui::DragFloat3("Position", &obj.position.x, 0.1f);
    ImGui::DragFloat3("Rotation", &obj.rotation.x, 1.0f);
    ImGui::DragFloat3("Scale", &obj.scale.x, 0.01f);
    ImGui::ColorEdit4("Color", &obj.color.r);

    if (ImGui::CollapsingHeader("Physics")) {
        ImGui::DragFloat("Mass", &obj.mass, 0.1f);
        ImGui::Checkbox("Is Static", &obj.isStatic);
    }

    ImGui::End();
}
§05

Related on TokRepo

§06

Common pitfalls

  • ImGui is designed for debug and tool UI, not end-user-facing applications. It looks functional rather than polished.
  • Each frame redraws the entire UI. For complex UIs with thousands of elements, this can impact frame budgets.
  • ImGui requires a rendering backend (OpenGL, DirectX, Vulkan, Metal). Integration complexity varies by backend.
  • Text rendering uses a built-in bitmap font. Custom fonts require loading TTF files with ImGui's font atlas.
  • The library is single-threaded by design. Multi-threaded rendering requires careful synchronization.
  • Review the official documentation before deploying to production to ensure compatibility with your specific environment and requirements.

Frequently Asked Questions

What is immediate mode GUI?+

In immediate mode, you call UI functions each frame and the library draws them immediately. There is no persistent widget tree or state management. This is simpler to code but redraws everything each frame, unlike retained-mode frameworks that update only changed elements.

Which game engines use Dear ImGui?+

Dear ImGui is used in Unreal Engine, Unity (via plugins), Godot (via addons), custom engines at major studios, and thousands of indie games. It is the de facto standard for game engine tooling.

Does Dear ImGui support multiple windows?+

Yes. ImGui supports multiple windows, docking (merging windows into tab groups), and viewports (rendering ImGui windows outside the main application window).

Can I style Dear ImGui?+

Yes. ImGui supports theming through its style system. You can customize colors, sizes, rounding, and spacing for all widget types. Community themes provide polished looks.

Is Dear ImGui suitable for non-game applications?+

Yes. ImGui is used in audio editors, CAD tools, scientific visualization, and any C++ application that benefits from quick, functional UI. The key requirement is a render loop.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets