From 9224412274e1e1a31a959083bb257a7d6ab2b113 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 19 Aug 2016 20:40:12 -0400 Subject: Add Sly manual. --- manuals/sly/The-Game-Loop.html | 114 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 manuals/sly/The-Game-Loop.html (limited to 'manuals/sly/The-Game-Loop.html') diff --git a/manuals/sly/The-Game-Loop.html b/manuals/sly/The-Game-Loop.html new file mode 100644 index 0000000..f8a685d --- /dev/null +++ b/manuals/sly/The-Game-Loop.html @@ -0,0 +1,114 @@ + + + + + +Sly: The Game Loop + + + + + + + + + + + + + + + + + + + + +
+

+Previous: , Up: Booting   [Contents][Index]

+
+
+ +

4.1.2 The Game Loop

+ +
+
Scheme Variable: draw-hook
+

This hook is run every time the game loop wants to render. Procedures +added to this hook should accept two arguments: dt, the time in +seconds since the last render call; and alpha, a number in the +range [0,1] that indicates how far in between two discrete updates of +the game state the loop is in. The alpha value is important +for smoothing animated values to avoid the “temporal aliasing” +effect that causes choppy looking animations. +

+ +
+
Scheme Variable: after-game-loop-error-hook
+

This hook is run every time the game loop catches an error. +Procedures added to this hook should accept no arguments. +

+ +
+
Scheme Procedure: run-game-loop [#:frame-rate] [#:tick-rate] [#:max-ticks-per-frame]
+

Start the game loop. frame-rate specifies the optimal number +of frames to draw per second. tick-rate specifies the optimal +game logic updates per second. Both frame-rate and +tick-rate are 60 by default. max-ticks-per-frame is the +maximum number of times the game loop will update game state in a +single frame. When this upper bound is reached due to poor +performance, the game will start to slow down instead of becoming +completely unresponsive and possibly crashing. +

+ +
+
Scheme Procedure: stop-game-loop
+

Abort the game loop. +

+ + + + + -- cgit v1.2.3