[OpenTK] Respect a TargetUpdatePeriod of zero
authorStefanos A. <stapostol@gmail.com>
Tue, 14 Jan 2014 12:33:41 +0000 (13:33 +0100)
committerStefanos A. <stapostol@gmail.com>
Tue, 14 Jan 2014 12:33:41 +0000 (13:33 +0100)
Source/OpenTK/GameWindow.cs

index af55fe0..9200216 100644 (file)
@@ -455,6 +455,15 @@ namespace OpenTK
 
                 // Prepare for next loop
                 elapsed = ClampElapsed(timestamp - update_timestamp);
+
+                if (TargetUpdatePeriod <= Double.Epsilon)
+                {
+                    // According to the TargetUpdatePeriod documentation,
+                    // a TargetUpdatePeriod of zero means we will raise
+                    // UpdateFrame events as fast as possible (one event
+                    // per ProcessEvents() call)
+                    break;
+                }
             }
 
             elapsed = ClampElapsed(timestamp - render_timestamp);