From 95d71bc0ccc1b1ad25a9afda81b56efd9f14932c Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Tue, 14 Jan 2014 13:33:41 +0100 Subject: [PATCH] [OpenTK] Respect a TargetUpdatePeriod of zero --- Source/OpenTK/GameWindow.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/OpenTK/GameWindow.cs b/Source/OpenTK/GameWindow.cs index af55fe0..9200216 100644 --- a/Source/OpenTK/GameWindow.cs +++ b/Source/OpenTK/GameWindow.cs @@ -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); -- 2.7.4