What’s Immediate Mode?

Print anything with Printful



Immediate mode is a rendering state that bypasses the normal sequence of actions and allows a program to directly call functions to display on a monitor. It is used for fast rendering times in multimedia applications and video games. Mixed-mode combines preserved-mode rendering with immediate-mode styling functions, but can create difficult-to-debug code.

In computer graphics programming, immediate mode is a rendering state in which the normal sequence of actions and the framework in which they exist are completely bypassed and, in some cases, disabled. This means that the running application must directly call the functions needed to display anything on a display device such as a monitor instead of relying on innate loops outside the program. Immediate mode is often used for programs that require the fastest possible rendering times, such as multimedia applications or video games, or it is used as a teaching aid when learning to use complex graphics libraries. A poorly designed or incorrectly implemented program that uses immediate mode rendering can cause screen shots or blank areas of a screen to appear and persist, because no automatic calls are made to redraw the current frame, if necessary. One variant is known as mixed-mode, where a program holds the maintained rendering framework in place while trying to control some parts of it via immediate-mode styling functions.

In many computer applications, information or graphics are rendered to a display device through an event-driven program architecture. This means that the screen only redraws in response to some type of input from a program or user. This works well for programs like word processors or web browsers, but not for applications like media players, art rendering software, or video games where a screen may need to redraw 60 or more times per second without any sort of input. The solution is to use immediate mode.

Instead of allowing an operating system or graphics library to control when and how a display is updated and rendered, the program takes complete control, removing any barriers between the display device and the application code. In this way, a program can create its own display loop, using timers and other custom code, so that the screen redraws as many or as few times as necessary to achieve the desired result. A complication of using immediate mode is that some of the transparent features of preserved mode rendering, such as a geometry engine, may not be available, requiring the application to have its own implementations. Another problem is that a program can require a large amount of processing power to keep the render cycle at an acceptable speed.

An alternative to using immediate mode only is to use a mixed rendering mode. In this project, the preserved-mode rendering framework is kept in place so that you can use all the features of a graphics library, but some functions or methods are overridden and replaced with user-generated code that can break the rendering framework existing to function in a way that is more like immediate mode. This method can be effective, but it can also create code that is difficult to debug and may have unexpected results, depending on how user code and library code interact.




Protect your devices with Threat Protection by NordVPN


Skip to content