mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Simplify sf::Clock
usage
This commit is contained in:
parent
1e1c13b51d
commit
08cfbc7d6c
@ -187,8 +187,7 @@ void Window::display()
|
||||
// Limit the framerate if needed
|
||||
if (m_frameTimeLimit != Time::Zero)
|
||||
{
|
||||
sleep(m_frameTimeLimit - m_clock.getElapsedTime());
|
||||
m_clock.restart();
|
||||
sleep(m_frameTimeLimit - m_clock.restart());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -258,8 +258,7 @@ void EaglContext::display()
|
||||
if (m_vsyncEnabled)
|
||||
{
|
||||
constexpr Time frameDuration = seconds(1.f / 60.f);
|
||||
sleep(frameDuration - m_clock.getElapsedTime());
|
||||
m_clock.restart();
|
||||
sleep(frameDuration - m_clock.restart());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user