Permalink
Browse files

[OpenTK] Implemented GameWindow.UpdateTime and RenderTime properties

  • Loading branch information...
thefiddler committed Jan 7, 2014
1 parent 3856fcd commit 56a3dd91e5243a9d16ece6070cb94b5fe1564320
Showing with 3 additions and 0 deletions.
  1. +3 −0 Source/OpenTK/GameWindow.cs
@@ -446,13 +446,16 @@ void DispatchUpdateAndRenderFrame(object sender, EventArgs e)
update_timestamp = timestamp;
}
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);
if (RaiseRenderFrame(render_elapsed, ref next_render))
{
render_timestamp = timestamp;
}
+ timestamp = watch.Elapsed.TotalSeconds;
+ render_time = timestamp - render_timestamp;
}
bool RaiseUpdateFrame(double time, ref double next_update)

0 comments on commit 56a3dd9

Please sign in to comment.