Generate UpdateFrame events even if TargetUpdateFrequency is 0. According to the documentation, setting this value to 0 will result in unconstrained UpdateFrame frequency. Fixes issue [#1294]: "OnUpdateFrame function does not work with maximum update rate".

This commit is contained in:
the_fiddler 2009-10-27 22:23:11 +00:00
parent 721277d7f7
commit 852fdc3662

View file

@ -448,17 +448,19 @@ namespace OpenTK
OnUpdateFrameInternal(update_args);
update_time = update_watch.Elapsed.TotalSeconds;
}
if (TargetUpdateFrequency == 0.0)
break;
time = update_watch.Elapsed.TotalSeconds;
next_update -= time;
// Stopwatches are not accurate over long time periods.
// We accumlate the total elapsed time into the time variable
// while reseting the Stopwatch frequently.
update_watch.Reset();
update_watch.Start();
if (TargetUpdateFrequency == 0.0)
break;
next_update -= time;
}
// Calculate statistics