mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-23 22:58:30 +00:00
[OpenTK] Frameskip needs TargetUpdateFrequency!=0
This commit is contained in:
parent
19eb72b3a9
commit
c31f64f7e1
|
@ -441,20 +441,23 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
// Raise UpdateFrame events until we catch up with our target update rate.
|
// Raise UpdateFrame events until we catch up with our target update rate.
|
||||||
double update_elapsed = MathHelper.Clamp(timestamp - update_timestamp, 0.0, 1.0);
|
double update_elapsed = MathHelper.Clamp(timestamp - update_timestamp, 0.0, 1.0);
|
||||||
if (RaiseUpdateFrame(update_elapsed))
|
if (update_elapsed > 0)
|
||||||
{
|
{
|
||||||
update_period = update_elapsed;
|
if (RaiseUpdateFrame(update_elapsed))
|
||||||
update_timestamp = timestamp;
|
{
|
||||||
timestamp = watch.Elapsed.TotalSeconds;
|
update_period = update_elapsed;
|
||||||
update_time = timestamp - update_timestamp;
|
update_timestamp = timestamp;
|
||||||
|
timestamp = watch.Elapsed.TotalSeconds;
|
||||||
|
update_time = timestamp - update_timestamp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We have executed enough UpdateFrame events to catch up.
|
||||||
|
// Break and issue a RenderFrame event.
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
} while (TargetRenderFrequency > 0 && ++frameskip < max_frameskip);
|
||||||
{
|
|
||||||
// We have executed enough UpdateFrame events to catch up.
|
|
||||||
// Break and issue a RenderFrame event.
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while (++frameskip < max_frameskip);
|
|
||||||
|
|
||||||
timestamp = watch.Elapsed.TotalSeconds;
|
timestamp = watch.Elapsed.TotalSeconds;
|
||||||
double render_elapsed = MathHelper.Clamp(timestamp - render_timestamp, 0.0, 1.0);
|
double render_elapsed = MathHelper.Clamp(timestamp - render_timestamp, 0.0, 1.0);
|
||||||
|
|
Loading…
Reference in a new issue