The game loop
The game loop is the primary mechanism that moves the game forward in time. Before we learn how to create this important component, let's briefly take a look at the structure of most games.
The game structure
There are three phases to most games: the initialization phase, the game loop, and the shutdown phase. The core of any game is the game loop.
![The game structure](/api/v2/epubs/9781783288199/files/graphics/8199OS_01_07.jpg)
The game loop is a sequence of processes that run continuously as long as the game is running. The three main processes that occur in the game loop are input, update, and render.
The input process is how the player controls the game. This could be any combination of keyboard, mouse, or control ...
Get OpenGL Game Development By Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.