O'Reilly logo

Mastering SFML Game Development by Raimondas Pupius

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required