MainLoop
MainLoop is a term used to describe the central control flow that drives many interactive applications. It refers to the repetitive cycle that governs input processing, state updates, and output rendering. The loop is a core component in software ranging from desktop and mobile applications to games and certain embedded systems. It typically runs from program start until termination, continuously performing its cycle.
A common structure involves initialization, followed by a loop that repeats until a termination condition is
Contexts and variants: in game engines, the MainLoop synchronizes simulation with rendering and often implements timing
Key considerations include responsiveness, determinism, latency, and frame pacing. Proper time management and, when applicable, safe