summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-11-30 19:09:49 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-11-30 19:09:49 -0500
commit69574d5bf6f4af68104ebb207a417845fe93f72c (patch)
treea6709a757cf391f8560eb65bc0ef1816f8621d0e
parent48ab4e73f9250d0f3a242419a59652d4ae1a710c (diff)
render: group: Make context optional when drawing.
* sly/render/group (draw-group): Use global context by default.
-rw-r--r--sly/render/group.scm22
1 files changed, 12 insertions, 10 deletions
diff --git a/sly/render/group.scm b/sly/render/group.scm
index e3e53a3..ddcc94f 100644
--- a/sly/render/group.scm
+++ b/sly/render/group.scm
@@ -90,17 +90,19 @@ or not to render child nodes."
(array-set! matrix 0 3 2)
(array-set! matrix 1 3 3)))
-(define (draw-group group camera context)
- "Draw the scene defined by GROUP as viewed by CAMERA, with the given
+(define draw-group
+ (let ((context (make-render-context)))
+ (lambda* (group camera #:optional (context context))
+ "Draw the scene defined by GROUP as viewed by CAMERA, with the given
render CONTEXT."
- (with-temp-transform context view
- (transform*! view
- (camera-location camera)
- (camera-projection camera))
- (with-temp-transform context base-transform
- (set-transform-identity! base-transform)
- (apply-viewport (camera-viewport camera))
- (%draw-group group base-transform view context))))
+ (with-temp-transform context view
+ (transform*! view
+ (camera-location camera)
+ (camera-projection camera))
+ (with-temp-transform context base-transform
+ (set-transform-identity! base-transform)
+ (apply-viewport (camera-viewport camera))
+ (%draw-group group base-transform view context))))))
;;;
;;; Utility Procedures