summaryrefslogtreecommitdiff
path: root/chickadee.scm
diff options
context:
space:
mode:
Diffstat (limited to 'chickadee.scm')
-rw-r--r--chickadee.scm18
1 files changed, 12 insertions, 6 deletions
diff --git a/chickadee.scm b/chickadee.scm
index b9996e1..41a3d90 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -20,9 +20,12 @@
#:use-module (sdl2)
#:use-module (sdl2 events)
#:use-module (sdl2 input text)
+ #:use-module (chickadee color)
#:use-module (chickadee window)
+ #:use-module (chickadee render)
#:use-module (chickadee render gl)
#:use-module (chickadee render gpu)
+ #:use-module (chickadee render viewport)
#:export (load-hook
update-hook
before-draw-hook
@@ -142,7 +145,13 @@
(controller-axis-event-axis event)
(/ (controller-axis-event-value event) 32768.0)))))
(with-window window
- (let ((update-interval (round (/ 1000 update-hz))))
+ (let ((update-interval (round (/ 1000 update-hz)))
+ (default-viewport
+ (make-viewport 0 0 window-width window-height
+ ;; Just a fun color from the Dawnbringer
+ ;; 32-color palette instead of boring old
+ ;; black.
+ #:clear-color (rgb #x45283c))))
(call-with-prompt game-loop-prompt-tag
(lambda ()
;; Catch SIGINT and kill the loop.
@@ -170,11 +179,8 @@
(begin
;; Render a frame.
(run-hook before-draw-hook)
- (gl-clear-color 0.267 0.141 0.204 1.0)
- (gl-clear (logior (attrib-mask color-buffer)
- (attrib-mask depth-buffer)
- (attrib-mask stencil-buffer)))
- (run-hook draw-hook (/ lag update-interval))
+ (with-viewport default-viewport
+ (run-hook draw-hook (/ lag update-interval)))
(swap-buffers window)
(run-hook after-draw-hook)
(loop current-time lag)))))))