diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-11-30 19:09:49 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-11-30 19:09:49 -0500 |
commit | 69574d5bf6f4af68104ebb207a417845fe93f72c (patch) | |
tree | a6709a757cf391f8560eb65bc0ef1816f8621d0e | |
parent | 48ab4e73f9250d0f3a242419a59652d4ae1a710c (diff) |
render: group: Make context optional when drawing.
* sly/render/group (draw-group): Use global context by default.
-rw-r--r-- | sly/render/group.scm | 22 |
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 |