summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-01-25 22:09:26 -0500
committerDavid Thompson <dthompson2@worcester.edu>2017-01-25 22:09:26 -0500
commit11406eb75164ea8da06128b6cdb777c2e610cf97 (patch)
tree6ac66e764a1336c3c80efeb86413fe166ac10ab9
parent3fa1e5fea91f0ee3bcb607a7c876b6e5e6d99127 (diff)
Ensure that the viewport is cleared at the beginning of each frame.
* chickadee.scm (run-game): Switch to the null viewport at the beginning of each frame to ensure other viewports are cleared.
-rw-r--r--chickadee.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/chickadee.scm b/chickadee.scm
index 17cf33d..10136d9 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -179,6 +179,10 @@
(begin
;; Render a frame.
(run-hook before-draw-hook)
+ ;; Switch to the null viewport to ensure that
+ ;; the default viewport will be re-applied and
+ ;; clear the screen.
+ (gpu-state-set! *viewport-state* null-viewport)
(with-viewport default-viewport
(with-projection default-projection
(run-hook draw-hook (/ lag update-interval))))