The final bit of code
Lastly, the main entry point of our application is defined inside the main function, like so:
void main(int argc, void** argv[]){ // Program entry point. { Game game; while(!game.GetWindow()->IsDone()){ game.Update(); game.Render(); game.LateUpdate(); } } }
After an instance of Game
is set up, we begin a while
loop that keeps running until the Window
instance is closed. Inside the loop, we update the game, render it, and call the late update method as well, for all of those post-rendering tasks.