daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 220 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Game::RunMainloop()
  2. {
  3.     sf::Clock clock;
  4.     Scene* s = scenes.top();
  5.     while (MainWindow->isOpen())
  6.     {
  7.         MainWindow->clear();
  8.  
  9.         float UpdateTime = 0;
  10.        
  11.         while (UpdateTime < 1000.f / 60.f)
  12.         {
  13.             sf::Time time = clock.getElapsedTime();
  14.             UpdateTime += time.asMilliseconds();
  15.  
  16.             s->HandleEvents(*MainWindow);
  17.             s->UpdateScene(clock);
  18.         }
  19.         s->RenderScene(*MainWindow);
  20.  
  21.         MainWindow->display();
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top