Dear UI

This is an absolute eye-opener for me in terms of user interface. Randomly found watching YouTube videos found Dear ImGui library.

Strange name, huh?

This library is called Dear ImGui. Please refer to it as Dear ImGui (not ImGui, not IMGUI).

(The library misleadingly started its life in 2014 as “ImGui” due to the fact that I didn’t give it a proper name when when I released 1.0, and had no particular expectation that it would take off. However, the term IMGUI (immediate-mode graphical user interface) was coined before and is being used in variety of other situations e.g. Unity uses it own implementation of the IMGUI paradigm. To reduce the ambiguity without affecting existing code bases, I have decided in December 2015 a fully qualified name “Dear ImGui” for this library.

According to the home page:

Dear ImGui is a bloat-free graphical user interface library for C++. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).

The library is extremely small and is distributed as C++ source code, which can be included in your codebase. It’s GPU accelerated and supports various backends out of the box:

Officially maintained backends/bindings (in repository):

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

There are also endless amount of bindings to other languages available. Some good, some bad.

What’s So Good

ImGui is not a traditional UI framework. It follows a pattern of a so-called immediate mode rather than a traditional retained mode. The Immediate Mode GUI paradigm may at first appear unusual to some users. This is mainly because “Retained Mode” GUIs have been so widespread and predominant. The following links can give you a better understanding about how Immediate Mode GUIs works.

Another notable uses of IMGUI paradigm include Unity’s own IMGUI widget library, often informally referred to as OnGUI(), which is used to power the Unity editor and its extensions. This library is unrelated from Dear ImGui (different codebase, design, features and team). The IMGUI library used by Unity has in the past received mixed feedback from its users, presumably because it may have been perceived as a potential candidate for game-facing UI solutions, which it doesn’t excel at. However Unity has since provided separate libraries to tackle that case, and their IMGUI library is still very much in use for the Unity Editor and has been its UI backbone for the past 12+ years.

So ImGUI is mostly used in games. But also can be used to build desktop applications, but rather not for end users. These UIs are for writing utilities like profilers, debuggers, etc. This is how a typical UI looks in the game:

The UI is mostly used by game developers and power users to profile the game, tune options etc. However, one can build normal applications with it, starting from an old looking Retro Commander

to more complicated examples like a [Graph Editor](thedmd/imgui-node-editor: Node Editor using ImGui (github.com)) (more node samples here)

or a console emulator

people are making audio editors

terminal emulators

There’s even financial software developed with it

Great Python Story

Dear PyGUI project is not just a binding, but, according to the homepage

Dear PyGui is a simple to use (but powerful) Python GUI framework. Dear PyGui is NOT a wrapping of Dear ImGui in the normal sense. It is a library built with Dear ImGui which simulates a traditional retained mode GUI (as opposed to Dear ImGui’s immediate mode paradigm).

Which is exactly what it says - it doesn’t feel awkward to work in Python and doesn’t feel like half-ass bindings that are harder to use than C++, but rather a nice truly usable interface for quick prototyping.

Have a question⁉ Contact me.