|
|
@@ -28,13 +28,10 @@ void FramerateManager::framerateDelay()
|
|
|
{
|
|
|
Duration timeSpentBusy = Clock::now() - lastTimePoint;
|
|
|
|
|
|
- if(!vsyncEnabled)
|
|
|
+ if(!vsyncEnabled && timeSpentBusy < targetFrameTime)
|
|
|
{
|
|
|
// if FPS is higher than it should be, then wait some time
|
|
|
- if(timeSpentBusy < targetFrameTime)
|
|
|
- {
|
|
|
- boost::this_thread::sleep_for(targetFrameTime - timeSpentBusy);
|
|
|
- }
|
|
|
+ boost::this_thread::sleep_for(targetFrameTime - timeSpentBusy);
|
|
|
}
|
|
|
|
|
|
// compute actual timeElapsed taking into account actual sleep interval
|