1
Graphics / Re: Drawing problem
« on: November 30, 2014, 01:13:31 am »
I decided just to pass the window through the parameters, so i solved the problem. Thanks for telling me about the debugger! I never used it until now.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
const sf::Time Game::TimePerFrame = sf::seconds(1.f/60.f);
[...]
sf::Clock clock;
sf::Time timeSinceLastUpdate = sf::Time::Zero;
while (mWindow.isOpen())
{
sf::Time elapsedTime = clock.restart();
timeSinceLastUpdate += elapsedTime;
while (timeSinceLastUpdate > TimePerFrame)
{
timeSinceLastUpdate -= TimePerFrame;
processEvents();
update(TimePerFrame);
}
updateStatistics(elapsedTime);
render();
}