Immediate mode GUI

From Wikipedia, the free encyclopedia
  (Redirected from Immediate Mode GUI)
Jump to navigation Jump to search
Schematic explanation of an immediate mode graphics API

An immediate mode graphic user interface (GUI), also known as IMGUI, is a graphical user interface design pattern which uses an immediate mode graphics library to create the GUI. The other major pattern of API design in graphics libraries is the retained mode.[1]

Implementations[edit]

Most of the immediate mode GUI widget toolkit is implemented in default system controls and custom rendering for game development, graphic apps, Library: Scale form, and Dear ImGui.

For game implementation, a GUI should

  • be updated in sync with the game scene or complex graphic.
  • be overlaid on a game scene or complex graphic (which is especially easy in both cases, when both GUI and game scene are controlled by the game loop).
  • have an unusual appearance or be pepped with complex graphic. This implies that in an immediate mode GUI, the client code is holding its own rendering primitives and API design which affects the graphics pipeline implementation.

The immediate mode GUI widget toolkit

  • is more direct in the sense that the widget tree is often a function call tree that is compostable and flexible but hard to interact with.
  • is less complex and easier to understand (in terms of fewer implicit assumptions per toolset API call). This usually also results in less functionality.
  • is more elaborate to create and manage (typically needs more tool set API calls) if more than a simple widget tree, including layout (absolute and relative positioning referring to parent or siblings).
  • has less sophisticated occlusion culling (z-buffering), hit-testing, state change handling, scrolling, and focus/hot control (widget) animations. This also implies the need to manage the logical tree/visual tree itself.
  • has to rebuild the vertex buffers completely from scratch for each new frame.
  • can put a constant workload on the CPU if not utilizing shaders loaded on the GPU.

Immediate mode GUI widget toolkits are a good choice for those who prefer a simple, easily changeable, and extendable GUI toolkit. They are usually generic, open-source, and cross-platform. One way to have the flexibility and composability of an immediate mode GUI without the disadvantages of keeping the widget tree only in function calls, with the lack of direct control of how the GUI is drawn in the rendering engine would be to use a virtual widget tree, just like React uses a virtual DOM.

History[edit]

The original Immediate Mode GUI toolkit is imgui by Mikko Mononen[2] which is based on OpenGL. The idea was popularized by Casey Muratori.

Other types of Immediate Mode GUI[edit]

References[edit]

  1. ^ Radich, Quinn (May 30, 2018). "Retained Mode Versus Immediate Mode". Win32 apps. Microsoft. Retrieved 21 December 2019.
  2. ^ Mononen, Mikko (2019-12-18). "AdrienHerubel/imgui: A small multiplatform immediate mode graphical user interface with OpenGL3.2 backend".
  3. ^ Mettke, Micha (2019-12-22). "vurtun/nuklear: A single-header ANSI C gui library".
  4. ^ Korrovits, Tarvo (2019-12-19). "actsl/kiss_sdl: Simple generic GUI widget toolkit for SDL2".
  5. ^ "Gio - immediate mode GUI in Go". gioui.org. Retrieved 2019-11-14.
  6. ^ Cornut, Omar (2019-12-22). "ocornut/imgui: Dear ImGui: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies".
  7. ^ kotlin-graphics (2019-12-19). "kotlin-graphics/imgui: Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui)".