Revert "Simplify sf::Clock usage"

This reverts commit 08cfbc7d6c.
This commit is contained in:
Chris Thrasher 2024-06-05 00:11:37 -06:00 committed by Lukas Dürrenberger
parent 100c9a3e35
commit 3f38738a08
2 changed files with 4 additions and 2 deletions

View File

@ -187,7 +187,8 @@ void Window::display()
// Limit the framerate if needed
if (m_frameTimeLimit != Time::Zero)
{
sleep(m_frameTimeLimit - m_clock.restart());
sleep(m_frameTimeLimit - m_clock.getElapsedTime());
m_clock.restart();
}
}

View File

@ -258,7 +258,8 @@ void EaglContext::display()
if (m_vsyncEnabled)
{
constexpr Time frameDuration = seconds(1.f / 60.f);
sleep(frameDuration - m_clock.restart());
sleep(frameDuration - m_clock.getElapsedTime());
m_clock.restart();
}
}