I'm still new to game programming, so please forgive me if I'm asking a stupid question. I can't seem to wrap my head around how to find the time between frames (delta time) in SFML 2.0. I understand 1.6 had "GetFrameTime()" but that it is now removed.
I'm trying to get smoother player movement by multiplying velocity by delta time, but I need to figure out delta time first. Does anyone have an easy example for this?
I tried creating a function to calculate the delta time (runs once every screen render):
sf::Time currentTime;
//get current elapsed time of frame
currentTime = deltaClock.GetElapsedTime();
deltaTime = ( currentTime - prevDeltaTime );
prevDeltaTime = currentTime;
deltaClock.Restart();
And then multiplying player velocity by the variable "deltaTime" (which is of type sf::Time) but it either doesn't move the player at all or at very small/random intervals (if i multiply by deltaTime.AsMilliseconds())