diff options
-rwxr-xr-x | sandbox | 49 |
1 files changed, 26 insertions, 23 deletions
@@ -20,25 +20,25 @@ ;;; <http://www.gnu.org/licenses/>. ;; 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") |