From 74961faeba18772cd02c8d8f6bac3afda890020c Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 6 Nov 2019 08:25:09 -0500 Subject: render: Collect all managed GPU state into a single record type. --- chickadee.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chickadee.scm') diff --git a/chickadee.scm b/chickadee.scm index 3066f26..58513d4 100644 --- a/chickadee.scm +++ b/chickadee.scm @@ -144,6 +144,7 @@ not being pushed at all." #:size (list window-width window-height) #:fullscreen? window-fullscreen?)) (gl-context (make-gl-context window)) + (gpu (make-gpu gl-context)) (default-viewport (make-viewport 0 0 window-width window-height)) (default-projection (orthographic-projection 0 window-width window-height 0 @@ -221,7 +222,7 @@ not being pushed at all." ;; 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) + (set-gpu-viewport! gpu null-viewport) (with-viewport default-viewport (with-projection default-projection (draw alpha))) @@ -229,7 +230,8 @@ not being pushed at all." (dynamic-wind (const #t) (lambda () - (parameterize ((current-window window)) + (parameterize ((current-window window) + (current-gpu gpu)) ;; Attempt to activate vsync, if possible. Some systems do ;; not support setting the OpenGL swap interval. (catch #t -- cgit v1.2.3