mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-03 11:11:06 +00:00
[OpenTK] Fixed Update/RenderTime calculation
These values should only be re-calculated when an Update/RenderFrame event is raised. Otherwise, they should retain their previous values.
This commit is contained in:
parent
251f5717ae
commit
6e03d501ae
|
@ -445,9 +445,13 @@ namespace OpenTK
|
|||
{
|
||||
update_period = update_elapsed;
|
||||
update_timestamp = timestamp;
|
||||
timestamp = watch.Elapsed.TotalSeconds;
|
||||
update_time = timestamp - update_timestamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
timestamp = watch.Elapsed.TotalSeconds;
|
||||
}
|
||||
timestamp = watch.Elapsed.TotalSeconds;
|
||||
update_time = timestamp - update_timestamp;
|
||||
} while (next_update <= 0 && ++frameskip < max_frameskip);
|
||||
|
||||
double render_elapsed = MathHelper.Clamp(timestamp - render_timestamp, 0.0, 1.0);
|
||||
|
@ -455,9 +459,9 @@ namespace OpenTK
|
|||
{
|
||||
render_period = render_elapsed;
|
||||
render_timestamp = timestamp;
|
||||
timestamp = watch.Elapsed.TotalSeconds;
|
||||
render_time = timestamp - render_timestamp;
|
||||
}
|
||||
timestamp = watch.Elapsed.TotalSeconds;
|
||||
render_time = timestamp - render_timestamp;
|
||||
}
|
||||
|
||||
bool RaiseUpdateFrame(double time, ref double next_update)
|
||||
|
|
Loading…
Reference in a new issue