summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-09-07 22:09:07 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-09-07 22:09:07 -0400
commit8e9063f54783b015223346aac471c7b48c773438 (patch)
tree1ce89f4e2b3664a4b04b36074759c7e6cd6db96e
parent46f7884f9517a9717b2777e64ce94100a338f27e (diff)
scene: Add simple DSL for creating scene nodes.
* sly/scene.scm (scene-root): Use make-scene-node instead of scene-node. (scene-node): Create a more pleasant syntax for defining scene nodes.
-rw-r--r--sly/scene.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/sly/scene.scm b/sly/scene.scm
index d133d37..b523c72 100644
--- a/sly/scene.scm
+++ b/sly/scene.scm
@@ -62,7 +62,9 @@
(recompute-transform! node 0)
node))
-(define scene-node make-scene-node)
+(define-syntax-rule (scene-node (field val) ...)
+ (apply make-scene-node
+ (append (list (symbol->keyword 'field) val) ...)))
(define (scene-node-dirty? node)
(define (different? a b)
@@ -73,7 +75,7 @@
(different? scene-node-rotation scene-node-prev-rotation)))
(define (scene-root . children)
- (scene-node #:children children))
+ (make-scene-node #:children children))
(define (update-scene-node node)
(signal-let ((node node))