Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Help With Replacement for GetFrameTime()  (Read 1104 times)

0 Members and 1 Guest are viewing this topic.

shakenbake158

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Help With Replacement for GetFrameTime()
« on: December 16, 2014, 12:09:01 am »
Hey guys, I am following a tutorial for SFML, and it is a bit outdated. The tutorial is using a function called GetFrameTime that is no longer supported in SFML.

void GameObjectManager::UpdateAll()
{
  std::map<std::string,VisibleGameObject*>::const_iterator itr =
                                              _gameObjects.begin();
  float timeDelta = Game::GetWindow().GetFrameTime();

  while(itr != _gameObjects.end())
  {
    itr->second->Update(timeDelta);
    itr++;
  }
 
}


How would I replace the GetFrameTime function here?

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Help With Replacement for GetFrameTime()
« Reply #1 on: December 16, 2014, 12:20:35 am »
Take a look at the official SFML time tutorial. In the very last code snippet on this page the computation of elapsed is pretty much the same as the old GetFrameTime.