Retained mode


Retained mode in computer graphics is a major pattern of API design in graphics libraries, in which
Immediate 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 exclusionary in practice.

Overview

In retained mode the client calls do not directly cause actual rendering, but instead updates an abstract internal model which is maintained within the library's data space. This allows the library to optimize when actual rendering takes place along with the processing of related objects.
Some techniques to optimize rendering include:
Example of coexistence with immediate mode in the same library is OpenGL. OpenGL has immediate mode functions that can use previously defined server side objects without resending unchanged data.
Examples of retained mode rendering systems include Windows Presentation Foundation, SceneKit on macOS, and PHIGS.
There is another major pattern of API design in graphics libraries - the Immediate mode.