Permalink
Browse files

[OpenTK] Corrected GameWindow.Update/RenderFrequency information

  • Loading branch information...
1 parent 56a3dd9 commit 99df27b6356a0d9b6f20ce48f90ba1258c0e3f8a @thefiddler thefiddler committed Jan 7, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/OpenTK/GameWindow.cs
@@ -443,6 +443,7 @@ void DispatchUpdateAndRenderFrame(object sender, EventArgs e)
double update_elapsed = MathHelper.Clamp(timestamp - update_timestamp, 0.0, 1.0);
if (RaiseUpdateFrame(update_elapsed, ref next_update))
{
+ update_period = update_elapsed;
update_timestamp = timestamp;
}
timestamp = watch.Elapsed.TotalSeconds;
@@ -452,6 +453,7 @@ void DispatchUpdateAndRenderFrame(object sender, EventArgs e)
double render_elapsed = MathHelper.Clamp(timestamp - render_timestamp, 0.0, 1.0);
if (RaiseRenderFrame(render_elapsed, ref next_render))
{
+ render_period = render_elapsed;
render_timestamp = timestamp;
}
timestamp = watch.Elapsed.TotalSeconds;
@@ -475,7 +477,6 @@ bool RaiseUpdateFrame(double time, ref double next_update)
// once the load becomes lighter.
next_update += TargetUpdatePeriod;
next_update = Math.Max(next_update, -1.0);
- update_period = Math.Max(next_update, 0.0);
return true;
}
}
@@ -497,7 +498,6 @@ bool RaiseRenderFrame(double time, ref double next_render)
// the process does not appear to hang.
next_render += TargetRenderPeriod;
next_render = Math.Max(next_render, -1.0);
- render_period = Math.Max(next_render, 0.0);
return true;
}
}

0 comments on commit 99df27b

Please sign in to comment.