![Immediate-mode-graphics-api](https://upload.wikimedia.org/wikipedia/commons/0/00/Immediate-mode-graphics-api.png)
An immediate mode graphic user interface (GUI), also known as IMGUI, is a
graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inst ...
design pattern
A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander and has been adapted for various other disciplines, particularly software engineering. The "Gang of Four" boo ...
which uses an
immediate mode graphics
library
A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
to create the GUI. The other major pattern of
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
design in
graphics libraries is the
retained mode
Retained mode in computer graphics is a major pattern of API design in graphics libraries, in which
* the graphics library, instead of the client, retains the scene (complete object model of the rendering primitives) to be rendered and
* the ...
.
Implementations
Most of the
immediate mode GUI
widget toolkit
A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of programs.
Most widge ...
is implemented in default system controls and custom rendering for
game development
Video game development (or gamedev) is the process of developing a video game. The effort is undertaken by a developer, ranging from a single person to an international team dispersed across the globe. Development of traditional commercial PC ...
, graphic apps, Library: Scale form, and Dear ImGui.
For game implementation, a
GUI
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
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
Client(s) or The Client may refer to:
* Client (business)
* Client (computing), hardware or software that accesses a remote service on another computer
* Customer or client, a recipient of goods or services in return for monetary or other valuabl ...
code is holding its own
rendering primitive
This is a glossary of terms relating to computer graphics.
For more general computer hardware terms, see glossary of computer hardware terms.
0–9
A
B
...
s and API design which affects the
graphics pipeline
In computer graphics, a computer graphics pipeline, rendering pipeline or simply graphics pipeline, is a conceptual model that describes what steps a graphics system needs to perform to render a 3D scene to a 2D screen. Once ...
implementation.
The
immediate mode GUI
widget toolkit
A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of programs.
Most widge ...
* is more direct in the sense that the
widget tree is often a function call tree that is composable 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
In 3D computer graphics, hidden-surface determination (also known as shown-surface determination, hidden-surface removal (HSR), occlusion culling (OC) or visible-surface determination (VSD)) is the process of identifying what surfaces and parts o ...
(
z-buffering
A depth buffer, also known as a z-buffer, is a type of data buffer used in computer graphics to represent depth information of objects in 3D space from a particular perspective. Depth buffers are an aid to rendering a scene to ensure that the ...
),
hit-testing In computer graphics programming, hit-testing (hit detection, picking, or pick correlation ) is the process of determining whether a user-controlled cursor (such as a mouse cursor or touch-point on a touch-screen interface) intersects a given graphi ...
, state change handling,
scrolling
In computer displays, filmmaking, television production, and other kinetic displays, scrolling is sliding text, images or video across a monitor or display, vertically or horizontally. "Scrolling," as such, does not change the layout of the text ...
, and
focus
Focus, or its plural form foci may refer to:
Arts
* Focus or Focus Festival, former name of the Adelaide Fringe arts festival in South Australia Film
*''Focus'', a 1962 TV film starring James Whitmore
* ''Focus'' (2001 film), a 2001 film based ...
/hot
control
Control may refer to:
Basic meanings Economics and business
* Control (management), an element of management
* Control, an element of management accounting
* Comptroller (or controller), a senior financial officer in an organization
* Controllin ...
(
widget) animations. This also implies the need to manage the logical tree/visual tree itself.
* has to rebuild the
vertex buffer
This is a glossary of terms relating to computer graphics.
For more general computer hardware terms, see glossary of computer hardware terms.
0–9
A
B
...
s completely from scratch for each new
frame
A frame is often a structural system that supports other components of a physical construction and/or steel frame that limits the construction's extent.
Frame and FRAME may also refer to:
Physical objects
In building construction
*Framing (con ...
.
* can put a constant workload on the
CPU if not utilizing
shaders
In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene - a process known as ''shading''. Shaders have evolved to perform a variety of speci ...
loaded on the
GPU
A graphics processing unit (GPU) is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systems, mobi ...
.
Immediate mode GUI
widget toolkit
A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of programs.
Most widge ...
s 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
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
is drawn in the
rendering engine would be to use a virtual
widget tree, just like
React REACT or React may refer to:
Science and technology
*REACT (telescope), a telescope at Fenton Hill Observatory, New Mexico, US
Computing
* React (JavaScript library) , a JavaScript library for building user interfaces, from Facebook
** React Nati ...
uses a virtual
DOM.
History
Casey Muratori
Casey may refer to:
Places Antarctica
*Casey Station
* Casey Range
Australia
* Casey, Australian Capital Territory
* City of Casey, Melbourne
* Division of Casey, electoral district for the House of Representatives
Canada
* Casey, Ontario
* C ...
developed the technique and coined the term "Single-path Immediate Mode Graphical User Interface" to describe it. One of the earliest publicly available implementations was written by Sean Barrett.
Other types of immediate mode GUI
* Dear ImGui written in C++ with back-ends for several graphics APIs (
Allegro 5,
DirectX,
GLFW
GLFW (Graphics Library Framework) is a lightweight utility library for use with OpenGL. It provides programmers with the ability to create and manage windows and OpenGL contexts, as well as handle joystick, keyboard and mouse input.
Softwar ...
,
iOS
iOS (formerly iPhone OS) is a mobile operating system created and developed by Apple Inc. exclusively for its hardware. It is the operating system that powers many of the company's mobile devices, including the iPhone; the term also include ...
,
Marmalade
Marmalade is a fruit preserve made from the juice and peel of citrus fruits boiled with sugar and water. The well-known version is made from bitter orange. It is also made from lemons, limes, grapefruits, mandarins, sweet oranges, bergamot ...
,
Metal
A metal (from Greek μέταλλον ''métallon'', "mine, quarry, metal") is a material that, when freshly prepared, polished, or fractured, shows a lustrous appearance, and conducts electricity and heat relatively well. Metals are typicall ...
,
OpenGL,
SDL 2 and
Vulkan
Vulkan is a low- overhead, cross-platform API, open standard for 3D graphics and computing. Vulkan targets high-performance real-time 3D graphics applications, such as video games and interactive media. Vulkan is intended to offer higher perfor ...
), that also has
** projects for additional back-end support (
Android,
Irrlicht Engine
Irrlicht (pronounced in German) is an open-source game engine written in C++. It is cross-platform, officially running on Windows, macOS, Linux and Windows CE and due to its open nature ports to other systems are available, including FreeBSD, X ...
,
OGRE
An ogre (feminine: ogress) is a legendary monster depicted as a large, hideous, man-like being that eats ordinary human beings, especially infants and children. Ogres frequently feature in mythology, folklore, and fiction throughout the world ...
,
SFML, ...)
** projects for additional language bindings (
C#/.NET,
D,
Go,
Haskell
Haskell () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lan ...
,
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
, ...)
** ports to other languages (such as Java)
* egui for
Rust
Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO( ...
* Gio for
Go
* kiss_sdl for
SDL (Simple Direct Media Layer)
* nuklear
with backends for several graphics libraries (
Direct3D,
GLFW
GLFW (Graphics Library Framework) is a lightweight utility library for use with OpenGL. It provides programmers with the ability to create and manage windows and OpenGL contexts, as well as handle joystick, keyboard and mouse input.
Softwar ...
,
OpenGL,
SDL,
SFML,
Wayland, Windows
GDI
GDI may refer to:
Science and technology
* Gasoline direct injection, a type of fuel injection
* Graphics Device Interface, a component of Microsoft Windows
* Guanosine nucleotide dissociation inhibitor, a protein
Organisations
* Gabriel Dumont I ...
, Window
GDI+
The Graphics Device Interface (GDI) is a legacy component of Microsoft Windows responsible for representing graphical objects and transmitting them to output devices such as monitors and printers. Windows apps use Windows API to interact with G ...
and
X11
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.
X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wi ...
)
References
{{Reflist
Computer graphics
Graphical user interfaces