summaryrefslogtreecommitdiff
path: root/sly/game.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-01-11 08:37:42 -0500
committerDavid Thompson <dthompson2@worcester.edu>2016-01-12 08:38:44 -0500
commitd21b67eaad50c9389e1ad83cc595d2e77783942c (patch)
treefb2642a4c14f63d01a6d1fe193676b7ea024d866 /sly/game.scm
parent3c349c76e44ae4f5789a2f9e68f6ad260d212a30 (diff)
render: Add alpha value to render context.
Necessary for interpolating moving objects to avoid temporal aliasing. * sly/render.scm (<graphics>)[alpha]: New field. (graphics-alpha, set-graphics-alpha!): New procedure. * sly/game.scm (run-game-loop): Set the frame's alpha value before each render call.
Diffstat (limited to 'sly/game.scm')
-rw-r--r--sly/game.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/sly/game.scm b/sly/game.scm
index 5f1a1ec..722bfc0 100644
--- a/sly/game.scm
+++ b/sly/game.scm
@@ -84,7 +84,9 @@ instead of becoming completely unresponsive and possibly crashing."
(gl-viewport 0 0 (vx size) (vy size)))
(gl-clear (clear-buffer-mask color-buffer depth-buffer))
(run-hook draw-hook dt alpha)
- (with-graphics gfx ((signal-ref scene) gfx))
+ (with-graphics gfx
+ (set-graphics-alpha! gfx alpha)
+ ((signal-ref scene) gfx))
(swap-window))
(define (update lag)