What Is ImGui? Dear ImGui Explained (2026)

ImGui (Dear ImGui) is an immediate-mode GUI library for C++. It draws menus every frame with no retained widget tree, common in game tools and native clients.

Librariesby trqUpdated June 4, 2026
Key takeaways
  • ImGui (Dear ImGui) is a small immediate-mode GUI library for C++.
  • It draws the menu fresh every frame from function calls, with no widget tree to maintain.
  • Native clients and tools pick it for low-latency overlays over a 3D scene.
  • It is a C++ pattern; a Java Fabric mod uses the game's own GUI hooks instead.

ImGui, short for Dear ImGui, is a small immediate-mode GUI library for C++. It draws a menu fresh every frame from plain function calls instead of keeping a tree of widget objects around. That makes it fast to wire up and easy to drop on top of a game's existing render loop, which is why tooling and native clients use it for low-latency overlays.

Where Opal fits

Opal is a Fabric mod, so it builds its interface through the game's own GUI hooks rather than ImGui. If you want to add features without touching native code, the GraalVM JavaScript scripting engine is the place to start. See the setup guide and the scripting guide.

What immediate-mode means

ImGui rebuilds the interface on every frame. You do not create a button object and store it. You call a function that says "draw a button here," and that call both draws the button and tells you whether it was clicked this frame.

A retained-mode toolkit works the other way. It keeps a long-lived widget tree in memory, and you update that tree when state changes. Immediate-mode trades that persistent structure for code that reads top to bottom and lives next to your own state.

Why tools and clients pick it

ImGui is popular for menus that sit over a 3D scene. The reasons are practical.

  • Low latency: it hooks into a frame the program already renders, so the menu reacts right away.
  • Little glue: a window and a few controls are a handful of function calls. There is no layout file and no separate UI thread to manage.
  • Self-contained: the library has few dependencies and slots into common graphics backends, so it does not pull in a heavy framework.
  • Debug-friendly: the same calls that build a release menu also build the throwaway debug panels developers use while building a feature.

Immediate-mode vs retained-mode

AspectImmediate-mode (ImGui)Retained-mode toolkit
State ownershipYour code holds the dataThe toolkit holds a widget tree
Per-frame workRebuild the UI each frameUpdate the tree on change
Setup costA few function callsMore structure up front
Best fitOverlays, tools, game menusLarge document-style apps

How it fits a native client

A native utility client built in C++ often draws its menu with ImGui over the game's frame. The menu code runs inside the render loop, reads the client's own settings, and writes changes straight back. There is no separate UI process, so toggling a feature is one function call against a value the client already owns.

This is a C++ pattern. A Fabric mod written in Java reaches its interface through the game's own GUI hooks instead, so ImGui mostly shows up in clients that ship as native code rather than as Java mods.

FAQ