summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starling/kernel.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/starling/kernel.scm b/starling/kernel.scm
index e019b5b..193eb7b 100644
--- a/starling/kernel.scm
+++ b/starling/kernel.scm
@@ -74,6 +74,7 @@
(developer-mode? #:getter developer-mode? #:init-form #t)
(window #:accessor window)
(gl-context #:accessor gl-context)
+ (default-viewport #:accessor default-viewport)
(controllers #:accessor controllers #:init-thunk make-hash-table)
(repl #:accessor repl)
;; The scene stack.
@@ -211,7 +212,8 @@
;; the default viewport will be re-applied and
;; clear the screen.
(gpu-state-set! *viewport-state* null-viewport)
- (next-method)
+ (with-viewport (default-viewport kernel)
+ (next-method))
(swap-gl-window (window kernel)))
(define-method (on-error (kernel <kernel>) stack key args)
@@ -243,6 +245,8 @@
#:size (list (width wc) (height wc))
#:fullscreen? (fullscreen? wc)))
(set! (gl-context kernel) (make-gl-context (window kernel)))
+ (set! (default-viewport kernel)
+ (make-viewport 0 0 (width wc) (height wc)))
;; Attempt to activate vsync, if possible. Some systems do
;; not support setting the OpenGL swap interval.
(catch #t