Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double frametime = 1000000.f/60, delta = 0;
- void Game::gameLoop(sf::RenderWindow &window)
- {
- t = clock.getElapsedTime().asMicroseconds();
- if (t + delta >= frametime)
- {
- clock.restart();
- delta = t + delta - frametime;
- update();
- }
- render(window);
- }
Add Comment
Please, Sign In to add comment