mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
parent
100c9a3e35
commit
3f38738a08
@ -187,7 +187,8 @@ void Window::display()
|
|||||||
// Limit the framerate if needed
|
// Limit the framerate if needed
|
||||||
if (m_frameTimeLimit != Time::Zero)
|
if (m_frameTimeLimit != Time::Zero)
|
||||||
{
|
{
|
||||||
sleep(m_frameTimeLimit - m_clock.restart());
|
sleep(m_frameTimeLimit - m_clock.getElapsedTime());
|
||||||
|
m_clock.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +258,8 @@ void EaglContext::display()
|
|||||||
if (m_vsyncEnabled)
|
if (m_vsyncEnabled)
|
||||||
{
|
{
|
||||||
constexpr Time frameDuration = seconds(1.f / 60.f);
|
constexpr Time frameDuration = seconds(1.f / 60.f);
|
||||||
sleep(frameDuration - m_clock.restart());
|
sleep(frameDuration - m_clock.getElapsedTime());
|
||||||
|
m_clock.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user