Dear ImGui: A Lightweight C++ GUI Library for Tooling and Debugging

Dear ImGui is a **bloat-free graphical user interface library for C++**. It generates optimized vertex buffers that can be rendered at any time within an application using a 3D pipeline. Its fast, portable, renderer-agnostic, and self-contained (no external dependencies).

Dear ImGui is designed to **enable rapid iteration** and **empower programmers** to create **content creation tools and visualization/debugging tools** (as opposed to UI for end-users). It prioritizes simplicity and productivity for this goal, and consequently, lacks some features commonly found in more advanced libraries.

Dear ImGui is particularly well-suited for integration into game engines (for tools), real-time 3D applications, fullscreen applications, embedded applications, or any application on a console platform with non-standard operating system features.

Usage

The **core of Dear ImGui consists of several platform-agnostic files** that you can easily compile into your application/engine. They are all the files in the repository root folder (imgui.cpp, imgui.h, imgui_demo.cpp, imgui_draw.cpp, etc.).

**No specific build process is required**. You can add the .cpp files to your existing project.

You will need a backend to integrate Dear ImGui into your application. The backend passes mouse/keyboard/gamepad input and various settings to Dear ImGui and is responsible for rendering the final vertices.

**Backends for various graphics APIs and rendering platforms** are provided in the backends/ folder, as well as examples/ folder. See the Integration section for details. You can also create your own backend. Dear ImGui can be rendered anywhere you can render textured triangles.

Once Dear ImGui is set up in your application, you can use it anywhere in your program loop:

// Basic widget examples
ImGui::Text("Hello, world %d", 123);
if (ImGui::Button("Save"))
    MySaveFunction();
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);

(settings: Dark style (left), Light style (right) / Font: Roboto-Medium, 16px)

// Create a window named "My First Tool" with a menu bar.
ImGui::Begin("My First Tool", &my_tool_active, ImGuiWindowFlags_MenuBar);
if (ImGui::BeginMenuBar())
{
    if (ImGui::BeginMenu("File"))
    {
        if (ImGui::MenuItem("Open..", "Ctrl+O")) { /* Do stuff */ }
        if (ImGui::MenuItem("Save", "Ctrl+S"))   { /* Do stuff */ }
        if (ImGui::MenuItem("Close", "Ctrl+W"))  { my_tool_active = false; }
        ImGui::EndMenu();
    }
    ImGui::EndMenuBar();
}

// Edit a color (stored as ~4 floats)
ImGui::ColorEdit4("Color", my_color);

// Plot some values
const float my_values[] = { 0.2f, 0.1f, 1.0f, 0.5f, 0.9f, 2.2f };
ImGui::PlotLines("Frame Times", my_values, IM_ARRAYSIZE(my_values));

// Display contents in a scrolling region
ImGui::TextColored(ImVec4(1,1,0,1), "Important Stuff");
ImGui::BeginChild("Scrolling");
for (int n = 0; n < 50; n++)
    ImGui::Text("%04d: Some text", n);
ImGui::EndChild();
ImGui::End();

Dear ImGui allows you to **create sophisticated tools** as well as very transient ones. On the extreme end of the short-term spectrum: using a modern compiler's "edit-and-continue" (hot code reload) feature, you can add some widgets to tweak variables while your application is running, and delete the code a minute later! Dear ImGui is not just about tweaking values. You can use it to track running algorithms by issuing text commands. You can use it with your own reflection data to browse datasets in real-time. You can use it to expose internals of subsystems in your engine, create loggers, inspection tools, profilers, debuggers, entire game-making editors/frameworks, etc.

How it Works

If you want to understand the core principles behind the IMGUI paradigm, see the Wiki's section on the IMGUI paradigm. From a user's perspective, IMGUI aims to minimize redundant state duplication, state synchronization, and state retention. Compared to traditional retianed-mode UI, it is less error-prone (less code and fewer bugs) and can create dynamic user interfaces.

Dear ImGui outputs vertex buffers and a command list that you can easily render in your application. The number of draw calls and state changes required for drawing is very small. Because Dear ImGui cannot directly know or touch your graphics state, you can call its functions anywhere in your code (e.g., in the middle of a running algorithm or in the middle of your own rendering process). See the examples/ folder for example applications on how to integrate Dear ImGui with existing codebases.

A common misconception is to confuse immediate-mode GUI with immediate-mode rendering, which usually implies hammering the driver/GPU with a bunch of inefficient drawing calls and state changes when GUI functions are called. This is not what Dear ImGui does. Dear ImGui outputs vertex buffers and a small batch of draw calls. It never directly touches your GPU. The batching is very desirable, and you can render them later in your application or even remotely.

Releases

See Releases.

Examples

Calling ImGui::ShowDemoWindow() will create a demo window showcasing various features and examples. The code is always available for reference in imgui\_demo.cpp.

You should be able to build the example applications from source (tested on Windows / Mac / Linux). If you can't, let us know! If you want a quick look at some Dear ImGui features, you can download a Windows binary of the demo application here: -imgui-demo-binaries-20200918.zip (Windows, 1.78 WIP, built 2020/09/18, master branch) or older demo binaries.

The demo application doesn't support DPI, so it will look blurry on a 4K screen. To make your application DPI-aware, you can load/reload fonts at different scales and use style.ScaleAllSizes() (see FAQ).

Integration

On most platforms and when using C++, **you should be able to use a combination of imgui_impl_xxxx backends without modification** (e.g. imgui\_impl\_win32.cpp + imgui\_impl\_dx11.cpp). If your engine supports multiple platforms, consider using more imgui_impl_xxxx files rather than rewriting them: this will reduce work for you and you can get Dear ImGui running immediately. You can later decide to rewrite custom backends using custom engine features if you wish.

Integrating Dear ImGui into your custom engine boils down to 1) wiring mouse/keyboard/gamepad input 2) uploading a texture to the GPU/rendering engine 3) providing a render function that can bind a texture and render textured triangles. The examples/ folder is filled with applications doing this. If you are a proficient programmer and familiar with these concepts, it will take you less than two hours to integrate Dear ImGui into your custom engine. **Make sure to spend time reading the FAQ, comments, and some of the examples/ application!**

Officially maintained backends/bindings (in the repository):

  • Renderers: DirectX9, DirectX10, DirectX11, DirectX12, OpenGL (legacy), OpenGL3/ES/ES2 (modern), Vulkan, Metal.
  • Platforms: GLFW, SDL2, Win32, Glut, OSX.
  • Frameworks: Emscripten, Allegro5, Marmalade.

Third-party library backends/bindings wiki page:

  • Languages: C, C# and: Beef, ChaiScript, Crystal, D, Go, Haskell, Haxe/hxcpp, Java, JavaScript, Julia, Kotlin, Lua, Odin, Pascal, PureBasic, Python, Ruby, Rust, Swift ...
  • Frameworks: AGS/Adventure Game Studio, Amethyst, bsf, Cinder, Cocos2d-x, Diligent Engine, Flexium, GML/Game Maker Studio2, Godot, GTK3+OpenGL3, Irrlicht Engine, LÖVE+LUA, Magnum, NanoRT, nCine, Nim Game Lib, Ogre, openFrameworks, OSG/OpenSceneGraph, Orx, Photoshop, px_render, Qt/QtDirect3D, SFML, Sokol, Unity, Unreal Engine 4, vtk, Win32 GDI, WxWidgets.

Please note that the C bindings (cimgui) are auto-generated, and you can use its json/lua output to generate bindings for other languages.

Useful widgets and extensions wiki page:

  • Text editor, node editor, timeline editor, plotting, software renderer, remote network access, memory editor, small widgets, etc.

Also see the Wiki for more links and ideas.

Upcoming Changes

Some of the goals for 2020 are:

  • Work on Tables (see #2957, now merged in master.
  • Work on Docking (see #2109, in public docking branch)
  • Work on Multi-Viewport / Multiple OS windows. (see #1542, in public docking branch looking for feedback)
  • Work on gamepad/keyboard controls. (see #787)
  • Work on automation and testing system, both to test the library and end-user apps. (see #435)
  • Make the examples look better, improve styles, improve font support, make the examples hi-DPI and multi-DPI aware.

Gallery

For more user-submitted project screenshots using Dear ImGui, see the Gallery Threads!

For a list of third-party widgets and extensions, see the Useful Widgets wiki page.

Support, FAQ

See: Frequently Asked Questions (FAQ) for answers to common questions.

See: Wiki for many links, references and articles.

See: Articles about the IMGUI paradigm to read/learn about the immediate-mode GUI paradigm.

If you are new to Dear ImGui and encounter issues with: compiling, linking, adding fonts, wiring input, running or displaying Dear ImGui: you can use the Discord server.

Otherwise, for any other issues, bug reports, requests, feedback, you can post on https://github.com/ocornut/imgui/issues. Please read carefully and fill the new release template.

Private support is available for paying business customers (E-mail: *contact @ dearimgui dot com*).

Which version should I get?

We sometimes tag Releases, but generally it is safe and recommended to sync to master/latest. The library is quite stable, and regressions tend to be fixed quickly when reported.

Advanced users may wish to use the docking branch with Multi-Viewport and Docking / issues / 2109) features. This branch is regularly synced with the main branch.

Who is using Dear ImGui?

See the Quotes, Sponsors, Software using dear imgui Wiki pages to see who is using Dear ImGui. If you can, add your game/software! Also see Gallery Threads!

How can I help?

  • You can join the Discord server, GitHub forum/issues.
  • You can help develop and submit pull requests! Please understand that submitting a PR is also asking maintainers to review your code and then permanently take over its maintenance. PRs should be written to be in the best interest of end-users and easy for maintainers to understand and accept.
  • See Help wanted on the Wiki for some more ideas.
  • Get your company to financially support the project (contact via email)

Tags: Dear ImGui gui C++ Immediate Mode rendering

Posted on Sat, 13 Jun 2026 17:45:52 +0000 by ctsttom