» Glossary » Immediate mode VS retained mode
Graphics APIs can be divided into immediate and retained mode depending on how they operate:
- Immediate mode APIs: application state is separated from the graphics library. It’s the application responsibility to issue the drawing commands when necessary (for each frame, when some part of the state changes, etc).
- Retained mode APIs: the graphics library maintains internal state that caches/duplicates the application state. It’s the graphics library responsibility to draw the UI when that internal state changes. The graphics library often offers some callbacks for the application to update other parts of the state when the UI components state changes.
IMGUI: Immediate Mode Graphical User Interfaces
In 2002, two indie games programmers (Casey Muratori and Johannes Norneby) suggested using the immediate mode style to create User Interfaces.
- Immediate mode, video by Muratori (40 minutes).
- Immediate mode for game programmers, unfinished book by Norneby. It explores the idea and considers the evolution of UIs, MVC pattern, and OOP.
The first 10 minutes of Muratori’s intro video suffice to grasp the differences:
Immediate mode libraries for the web
- React is a JavaScript library to build User Interfaces that follow the immediate mode pattern.