From 34376403fe741cd7f2f0f7f97d1b3b2abe58c725 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 30 Nov 2014 22:56:08 -0500 Subject: Update the sandbox. * sandbox: Fix it. --- sandbox | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'sandbox') diff --git a/sandbox b/sandbox index 291979b..024408b 100755 --- a/sandbox +++ b/sandbox @@ -20,25 +20,25 @@ ;;; . ;; Include almost every Sly module for convenience. -(use-modules (sly agenda) - (sly audio) - (sly color) - (sly coroutine) - (sly font) +(use-modules (sly audio) (sly fps) (sly game) - (sly keyboard) - (sly mouse) - (sly rect) (sly signal) - (sly sprite) - (sly texture) - (sly transform) - (sly vector) (sly window) - (sly scene) - (sly camera) - (sly repl)) + (sly repl) + (sly utils) + (sly render color) + (sly render font) + (sly render sprite) + (sly render texture) + (sly render group) + (sly render model) + (sly render camera) + (sly input keyboard) + (sly input mouse) + (sly math rect) + (sly math transform) + (sly math vector)) (open-window) (start-sly-repl) @@ -47,18 +47,21 @@ (display "Welcome to the Sly sandbox. Happy hacking!\n") -(define-signal simple-scene - (scene-root - (scene-node - (position #(100 100)) - (uniforms `(("color" ,white))) - (children (list (load-sprite "examples/images/p1_front.png")))))) +(define-signal scene + (group)) (define-signal camera - (orthographic-camera simple-scene 640 480)) + (orthographic-camera 640 480)) + +(define (draw-scene dt alpha) + (signal-let ((scene scene) + (camera camera)) + (draw-group scene camera))) + +(add-hook! draw-hook (trampoline draw-scene)) (with-window (make-window #:title "Sly Sandbox") - (start-game-loop camera)) + (start-game-loop)) (display "Bye!\n") -- cgit v1.2.3