summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-01-11 08:45:05 -0500
committerDavid Thompson <dthompson2@worcester.edu>2016-01-12 08:38:51 -0500
commitffaf8f29987353a20fb47cfb681b64559f1fbda5 (patch)
treecde27badf2ea2ae36daf9ff031751493866f4fc5
parent39841de819a9c92ac5622a7caab66fd6fa31b533 (diff)
game-loop: Process input events before each agenda tick.
In practice this wasn't very noticeable, but it is a bad idea to lock input event processing with the frame rate. * sly/game.scm (run-game-loop): Process input events before each call to 'agenda-tick!'.
-rw-r--r--sly/game.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/sly/game.scm b/sly/game.scm
index 722bfc0..6e82b78 100644
--- a/sly/game.scm
+++ b/sly/game.scm
@@ -97,6 +97,7 @@ unused accumulator time."
(cond ((>= ticks max-ticks-per-frame)
lag)
((>= lag tick-interval)
+ (process-events)
(agenda-tick!)
(iter (- lag tick-interval) (1+ ticks)))
(else
@@ -124,7 +125,6 @@ time in the game tick accumulator."
(dt (- current-time previous-time)))
(catch #t
(lambda ()
- (process-events)
(let ((lag (update (+ lag dt))))
(draw dt (alpha lag))
(frame-sleep current-time)