diff options
author | David Thompson <dthompson2@worcester.edu> | 2023-11-05 07:19:40 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2023-11-08 21:35:34 -0500 |
commit | 979a62cafdd31ca18552d1e688ca1019e6e95c1e (patch) | |
tree | be17e1432c123b8848058c4b1d5e8b1f9fc89dbd /chickadee.scm | |
parent | d2adfa5c5bae5d8ee20564ec9e50cae4b75f945d (diff) |
webgpu wip stuffwip-gpu
Diffstat (limited to 'chickadee.scm')
-rw-r--r-- | chickadee.scm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chickadee.scm b/chickadee.scm index 8343a6b..289bc4d 100644 --- a/chickadee.scm +++ b/chickadee.scm @@ -313,7 +313,10 @@ border is disabled, otherwise it is enabled.") (orthographic-projection 0 window-width window-height 0 0 1))) - (gpu (make-gpu (unwrap-window window) (window-gl-context window)))) + (adapter (make-gpu-adapter)) + (device (gpu-adapter-request-device adapter + (unwrap-window window) + (window-gl-context window)))) (define (invert-y y) ;; SDL's origin is the top-left, but our origin is the bottom ;; left so we need to invert Y coordinates that SDL gives us. @@ -421,7 +424,7 @@ border is disabled, otherwise it is enabled.") ;; This is where all user code is executed. (define (game-loop) (parameterize ((current-window window) - (current-gpu gpu)) + (current-gpu-device device)) (run-game* #:init load #:update update #:render draw @@ -442,10 +445,10 @@ border is disabled, otherwise it is enabled.") ;; (clear-viewport) ;; (with-graphics-state ((projection (vector-ref default-projection 0))) ;; (draw alpha))) - (gpu-tick gpu) - (gpu-swap gpu) + (gpu-device-tick device) + (gpu-device-swap device) ;; Free any GPU resources that have been GC'd. - (gpu-gc gpu) + (gpu-device-gc device) (usleep 1) ; don't use 100% of the cpu pls (main-loop)) ;; Attempt to activate vsync, if possible. Some systems do |