diff options
Diffstat (limited to 'starling/kernel.scm')
-rw-r--r-- | starling/kernel.scm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/starling/kernel.scm b/starling/kernel.scm index 1aed4f3..42107b7 100644 --- a/starling/kernel.scm +++ b/starling/kernel.scm @@ -79,7 +79,7 @@ (define-class <fps-display> (<node>)) (define-method (on-boot (fps-display <fps-display>)) - (let* ((canvas (make <canvas> #:name 'canvas)) + (let* ((display (make <display-2d> #:name 'display)) (font (default-font)) (padding 4.0) (box-width (+ (font-line-width font "60.0") @@ -87,8 +87,8 @@ (box-height (+ (font-line-height font) (* padding 2.0)))) (call-with-values current-window-size (lambda (window-width window-height) - (attach-to canvas - (make <path> + (attach-to display + (make <canvas> #:painter (with-style ((fill-color (make-color 0 0 0 0.5))) (fill (rectangle (vec2 0.0 @@ -103,10 +103,10 @@ #:position (vec2 padding (+ (- window-height box-height) padding)))))) - (attach-to fps-display canvas))) + (attach-to fps-display display))) (define-method (update-fps (fps-display <fps-display>) fps) - (set! (text (& fps-display canvas fps-label)) + (set! (text (& fps-display display fps-label)) (format #f "~1,1f" fps))) @@ -367,7 +367,8 @@ (current-window (window kernel))) (activate kernel) (push-scene kernel (thunk)) - (run-game* #:update (lambda (dt) (update-tree kernel dt)) + (run-game* #:init (const #t) + #:update (lambda (dt) (update-tree kernel dt)) #:render (lambda (alpha) (render-tree kernel alpha)) #:error (lambda (stack key args) (on-error kernel stack key args)) |