diff options
-rw-r--r-- | Spear/App.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Spear/App.hs b/Spear/App.hs index f70dd06..1a0095b 100644 --- a/Spear/App.hs +++ b/Spear/App.hs | |||
@@ -57,16 +57,17 @@ loop' :: | |||
57 | loop' window ddt inputTimer elapsed timeBudget app = do | 57 | loop' window ddt inputTimer elapsed timeBudget app = do |
58 | timer <- gameIO $ tick inputTimer | 58 | timer <- gameIO $ tick inputTimer |
59 | 59 | ||
60 | inputEvents <- gameIO $ pollInputEvents window | ||
61 | |||
60 | let timeBudgetThisFrame = timeBudget + deltaTime timer | 62 | let timeBudgetThisFrame = timeBudget + deltaTime timer |
61 | let steps = timeBudgetThisFrame `div` ddt | 63 | let steps = timeBudgetThisFrame `div` ddt |
62 | 64 | ||
63 | continue <- and <$> forM [1..steps] (\i -> do | 65 | continue <- and <$> forM [1..steps] (\i -> do |
64 | let t = timeDeltaToSec $ elapsed + i * ddt | 66 | let t = timeDeltaToSec $ elapsed + i * ddt |
65 | let dt = timeDeltaToSec ddt | 67 | let dt = timeDeltaToSec ddt |
66 | inputEvents <- gameIO $ pollInputEvents window | ||
67 | stepApp app t dt inputEvents) | 68 | stepApp app t dt inputEvents) |
68 | 69 | ||
69 | let elapsed' = elapsed + steps * ddt | 70 | let elapsed' = elapsed + steps * ddt |
70 | let timeBudget' = timeBudgetThisFrame `mod` ddt | 71 | let timeBudget' = timeBudgetThisFrame `mod` ddt |
71 | 72 | ||
72 | when continue $ do | 73 | when continue $ do |