mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-06-18 07:40:16 +00:00
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
|
@ -448,17 +448,19 @@ namespace OpenTK
|
||||||
OnUpdateFrameInternal(update_args);
|
OnUpdateFrameInternal(update_args);
|
||||||
update_time = update_watch.Elapsed.TotalSeconds;
|
update_time = update_watch.Elapsed.TotalSeconds;
|
||||||
}
|
}
|
||||||
if (TargetUpdateFrequency == 0.0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
time = update_watch.Elapsed.TotalSeconds;
|
time = update_watch.Elapsed.TotalSeconds;
|
||||||
next_update -= time;
|
|
||||||
|
|
||||||
// Stopwatches are not accurate over long time periods.
|
// Stopwatches are not accurate over long time periods.
|
||||||
// We accumlate the total elapsed time into the time variable
|
// We accumlate the total elapsed time into the time variable
|
||||||
// while reseting the Stopwatch frequently.
|
// while reseting the Stopwatch frequently.
|
||||||
update_watch.Reset();
|
update_watch.Reset();
|
||||||
update_watch.Start();
|
update_watch.Start();
|
||||||
|
|
||||||
|
if (TargetUpdateFrequency == 0.0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
next_update -= time;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate statistics
|
// Calculate statistics
|
||||||
|
|
Loading…
Reference in a new issue