SFML community forums
Help => Window => Topic started by: Nexus on January 21, 2012, 10:58:24 am
-
What has happened to GetFrameTime()? Do you prefer it time is measured on user side? It looks like sf::Window already uses a clock for SetFramerateLimit(), doesn't it?
-
It was removed because it was not as good as a user-side clock.
It was mainly used to get the elapsed time to pass to update functions, but:
- the returned time was wrong (last frame duration instead of time elapsed since last update)
- there's no reason for such a function to be in the sf::Window class
The new way of measuring the update time is 100% accurate (also thanks to the new sf::Clock::Restart function):
sf::Clock clock;
...
Update(clock.Restart());
The other use of this function was to compute FPS, but I don't consider that it deserves a dedicated function in the public API.
-
Okay, then I am going to use sf::Clock directly in the future. Thanks for the explanation!