From: jpbruyere Date: Tue, 1 Mar 2016 12:58:59 +0000 (+0100) Subject: add fps X-Git-Tag: v0.4~93^2~5 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=2ad97c8acf95eac31a13b7ad6aec1a721d0bd0f8;p=jp%2Fcrow.git add fps --- diff --git a/OTKCrow/OpenTKGameWindow.cs b/OTKCrow/OpenTKGameWindow.cs index df1c4261..992019a8 100644 --- a/OTKCrow/OpenTKGameWindow.cs +++ b/OTKCrow/OpenTKGameWindow.cs @@ -248,17 +248,17 @@ namespace Crow protected override void OnUpdateFrame(FrameEventArgs e) { base.OnUpdateFrame(e); -// fps = (int)RenderFrequency; -// -// -// if (frameCpt > 50) { -// resetFps (); -// frameCpt = 0; -// GC.Collect(); -// GC.WaitForPendingFinalizers(); -// NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString()); -// } -// frameCpt++; + fps = (int)RenderFrequency; + + + if (frameCpt > 50) { + resetFps (); + frameCpt = 0; + GC.Collect(); + GC.WaitForPendingFinalizers(); + NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString()); + } + frameCpt++; //CrowInterface.Update (); } protected override void OnRenderFrame(FrameEventArgs e)