Hi
!
I put render() method into while loop like this:
void Application::run()
{
sf::Clock clock;
sf::Time timeSinceLastUpdate = sf::Time::Zero;
while (mWindow.isOpen())
{
sf::Time dt = clock.restart();
timeSinceLastUpdate += dt;
while (timeSinceLastUpdate > TimePerFrame)
{
timeSinceLastUpdate -= TimePerFrame;
processInput();
update(TimePerFrame);
// Check inside this loop, because stack might be empty before update() call
if (mStateStack.isEmpty())
mWindow.close();
render();
}
updateStatistics(dt);
}
}
and here is result, FPS is very high but it's seem not stability:
So, i want to ask that should i use this game loop?
Thanks