1
0
Fork 0
mirror of https://github.com/Ryujinx/Opentk.git synced 2025-03-28 19:37:04 +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 []: "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 4f2ac1753b
commit 68b2a5942b

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