Browse Source

Timeline: sleep for _the rest_ of the frame.

This wasn't well tested class.
pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
b0f640072c
  1. 2
      src/Timeline.cpp

2
src/Timeline.cpp

@ -42,7 +42,7 @@ void Timeline::nextFrame() {
_previousFrameDuration = duration/1e6f;
if(_previousFrameDuration < _minimalFrameTime) {
sleep(duration/1000);
sleep(_minimalFrameTime*1000 - duration/1000);
now = high_resolution_clock::now();
_previousFrameDuration = duration_cast<microseconds>(now-previousFrameTime).count()/1e6f;
}

Loading…
Cancel
Save