summaryrefslogtreecommitdiff
path: root/chickadee.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2020-04-11 22:55:30 -0400
committerDavid Thompson <dthompson2@worcester.edu>2020-04-11 22:55:30 -0400
commitd150acec04ddff321caae0cff88f6cc26161417c (patch)
tree69f0d388254983e065140cc1a09d189dc01f4c2f /chickadee.scm
parent94823dc194ac805939f91a68ca01d9c778f56b2b (diff)
render: viewport: Decouple screen clearing from viewport switching.
This makes it possible to a apply a viewport multiple times in a frame without clearing each time and wiping out part of your work.
Diffstat (limited to 'chickadee.scm')
-rw-r--r--chickadee.scm4
1 files changed, 1 insertions, 3 deletions
diff --git a/chickadee.scm b/chickadee.scm
index 4edeb03..e7fb443 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -321,10 +321,8 @@ border is disabled, otherwise it is enabled.")
;; Free any GPU resources that have been GC'd.
(gpu-reap!))
(define (render-sdl-opengl alpha)
- ;; Switch to the default viewport so we can clear the whole screen.
- (set-gpu-viewport! gpu default-viewport)
- (gl-clear clear-mask)
(with-viewport default-viewport
+ (clear-screen)
(with-projection default-projection
(draw alpha)))
(sdl2:swap-gl-window window))