Immediate mode is an
API design pattern in computer graphics libraries, in which
* 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 valuable ...
calls directly cause
rendering of graphics objects to the display, or in which
* the data to describe
rendering primitives is inserted
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 ...
by frame directly from 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 valuable ...
into a
command list
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
...
(in the case of ''
immediate mode primitive rendering''),
without the use of extensive indirection – thus'' immediate ''– to retained resources.
It does not preclude the use of
double-buffering.
Retained mode is an alternative approach. Historically, retained mode has been the dominant style in
GUI libraries;
however, both can coexist in the same library and are not necessarily exclusive in practice.
Overview

In immediate mode, the scene (complete
object model
In computing, object model has two related but distinct meanings:
# The properties of objects in general in a specific computer programming language, technology, notation or methodology that uses them. Examples are the object models of ''Java'', ...
of the
rendering primitives) is retained in the
memory space of 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 valuable ...
, instead of the
graphics library. This implies that in an immediate mode application, the lists of graphical objects to be
rendered are kept by 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 valuable ...
and are not saved by the graphics library API. The application must re-issue all drawing commands required to describe the entire scene each time a 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 ...
is required, regardless of actual changes. This method provides on the one hand a maximum of control and flexibility to the application program, but on the other hand it also generates continuous work load on the
CPU.

Examples of immediate mode rendering systems include
Direct2D
Direct2D is a 2D vector graphics application programming interface (API) designed by Microsoft and implemented in Windows 10, Windows 8, Windows 7 and Windows Server 2008 R2, and also Windows Vista and Windows Server 2008 (with Platform Update ...
,
OpenGL
OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
and
Quartz
Quartz is a hard, crystalline mineral composed of silica (silicon dioxide). The Atom, atoms are linked in a continuous framework of SiO4 silicon–oxygen Tetrahedral molecular geometry, tetrahedra, with each oxygen being shared between two tet ...
.
There are some
immediate mode GUIs that are particularly suitable when used in conjunction with immediate mode rendering systems.
Immediate mode primitive rendering
Primitive
vertex attribute data may be inserted
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 ...
by frame into a
command buffer by a
rendering API
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
...
. This involves significant bandwidth and processor time (especially if the
graphics processing unit
A graphics processing unit (GPU) is a specialized electronic circuit designed for digital image processing and to accelerate computer graphics, being present either as a discrete video card or embedded on motherboards, mobile phones, personal ...
is on a separate bus), but may be advantageous for data generated dynamically by the
CPU. It is less common since the advent of increasingly versatile
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 sp ...
, with which a
graphics processing unit
A graphics processing unit (GPU) is a specialized electronic circuit designed for digital image processing and to accelerate computer graphics, being present either as a discrete video card or embedded on motherboards, mobile phones, personal ...
may generate increasingly complex effects without the need for CPU intervention.
Immediate mode rendering with vertex buffers
Although drawing commands have to be re-issued 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 ...
, modern systems using this method are generally able to avoid the unnecessary duplication of more memory-intensive display data by referring to that unchanging data (via
indirection
In computer programming, an indirection (also called a reference) is a way of referring to something using a name, reference, or container instead of the value itself. The most common form of indirection is the act of manipulating a value through ...
) (e.g.
textures and
vertex buffers) in the drawing commands.
Immediate mode GUI
Graphical user interface
A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
s traditionally use
retained mode-style API design,
but immediate mode GUIs instead use an immediate mode-style API design, in which user code directly specifies the GUI elements to draw in the user input loop. For example, rather than having a CreateButton() function that a user would call once to instantiate a button, an immediate-mode GUI API may have a DoButton() function which should be called whenever the button should be on screen.
The technique was developed by
Casey Muratori in 2002.
Prominent implementations include Omar Cornut's Dear ImGui in C++ and Nic Barker's Clay
in C.
See also
*
Display list
A display list, also called a command list in Direct3D 12 and a command buffer in Vulkan, is a series of graphics commands or instructions that are run when the list is executed. Systems that make use of display list functionality are called ...
*
Retained mode, usually contrasted with immediate mode
*
Scene graph
A scene graph is a general data structure commonly used by vector-based graphics editing applications and modern computer games, which arranges the logical and often spatial representation of a graphical scene. It is a collection of nodes in a g ...
References
{{Reflist
Computer graphics
OpenGL
DirectX