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:
parent
721277d7f7
commit
852fdc3662
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue