summaryrefslogtreecommitdiff
path: root/sandbox
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-11-30 22:56:08 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-11-30 22:56:08 -0500
commit34376403fe741cd7f2f0f7f97d1b3b2abe58c725 (patch)
treefb2f0bcb54fc7a5a90bb188c91d80fbe24533cd8 /sandbox
parentbd8cabb94042d3060eb883c7012accd1ca4adc11 (diff)
Update the sandbox.
* sandbox: Fix it.
Diffstat (limited to 'sandbox')
-rwxr-xr-xsandbox49
1 files changed, 26 insertions, 23 deletions
diff --git a/sandbox b/sandbox
index 291979b..024408b 100755
--- a/sandbox
+++ b/sandbox
@@ -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")