From b5aa7cb9a857160e547718d184e89cb3221200a5 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 19 Oct 2024 21:05:41 -0400 Subject: WIP path stuff --- chickadee.scm | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'chickadee.scm') diff --git a/chickadee.scm b/chickadee.scm index 0654ea3..f726691 100644 --- a/chickadee.scm +++ b/chickadee.scm @@ -162,6 +162,7 @@ not being pushed at all." (define default-color-texture-view (make-parameter #f)) (define default-depth+stencil-texture-view (make-parameter #f)) +(define default-resolve-target (make-parameter #f)) (define* (make-window #:key (title "Chickadee") fullscreen? resizable? (width 640) (height 480)) @@ -303,6 +304,7 @@ border is disabled, otherwise it is enabled.") (vector (make-color-attachment #:view default-color-texture-view + #:resolve-target default-resolve-target #:operation (make-color-operation #:clear-color db32-viking))) #:depth+stencil-attachment @@ -417,7 +419,7 @@ border is disabled, otherwise it is enabled.") (current-projection default-projection) (current-pass default-render-pass)) (draw alpha)) - ((@@ (chickadee graphics) end-frame) (default-color-texture-view))) + ((@@ (chickadee graphics) end-frame) (default-resolve-target))) (define (on-error e stack) (error e stack) ;; Flush all input events that have occurred while in the error @@ -426,9 +428,11 @@ border is disabled, otherwise it is enabled.") (define (refresh-default-texture-views! width height) (let* ((old-color (default-color-texture-view)) (old-depth+stencil (default-depth+stencil-texture-view)) + (old-resolve-target (default-resolve-target)) (color-texture (make-texture #:name "Default color texture" #:width width - #:height height)) + #:height height + #:samples 4)) (color-view (make-texture-view color-texture #:name "Default color texture view")) (depth+stencil-texture (make-texture #:name "Default depth/stencil texture" @@ -436,11 +440,19 @@ border is disabled, otherwise it is enabled.") #:height height #:format 'depth24plus-stencil8)) (depth+stencil-view (make-texture-view depth+stencil-texture - #:name "Default depth/stencil texture view"))) + #:name "Default depth/stencil texture view")) + (resolve-target-texture (make-texture #:name "Default resolve target texture" + #:width width + #:height height)) + (resolve-target (make-texture-view resolve-target-texture + #:name "Default resolve target texture view"))) + ;; TODO: Destroy the underlying textures, too? (when old-color (destroy-texture-view old-color)) (when old-depth+stencil (destroy-texture-view old-depth+stencil)) + (when old-resolve-target (destroy-texture-view old-resolve-target)) (default-color-texture-view color-view) - (default-depth+stencil-texture-view depth+stencil-view))) + (default-depth+stencil-texture-view depth+stencil-view) + (default-resolve-target resolve-target))) (parameterize ((current-window window) (gpu:current-gpu gpu)) (refresh-default-texture-views! window-width window-height) @@ -452,8 +464,6 @@ border is disabled, otherwise it is enabled.") (lambda args (display "warning: could not enable vsync\n" (current-error-port)))) - ;; Turn off multisampling by default. - ;; (gl-disable (version-1-3 multisample)) ;; Enable seamless cube maps. ;; (gl-enable (version-3-2 texture-cube-map-seamless)) (sdl2:load-game-controller-mappings! -- cgit v1.2.3