Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Game::RunMainloop()
- {
- sf::Clock clock;
- Scene* s = scenes.top();
- while (MainWindow->isOpen())
- {
- MainWindow->clear();
- float UpdateTime = 0;
- while (UpdateTime < 1000.f / 60.f)
- {
- sf::Time time = clock.getElapsedTime();
- UpdateTime += time.asMilliseconds();
- s->HandleEvents(*MainWindow);
- s->UpdateScene(clock);
- }
- s->RenderScene(*MainWindow);
- MainWindow->display();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement