summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sly/render/renderer.scm5
-rw-r--r--sly/render/scene.scm10
2 files changed, 7 insertions, 8 deletions
diff --git a/sly/render/renderer.scm b/sly/render/renderer.scm
index fc9e5e6..498e00c 100644
--- a/sly/render/renderer.scm
+++ b/sly/render/renderer.scm
@@ -104,15 +104,12 @@ CONTEXT."
%null-pointer))))
(define-record-type <renderer>
- (%make-renderer context cameras ops)
+ (make-renderer context cameras ops)
renderer?
(context renderer-context)
(cameras renderer-cameras)
(ops renderer-ops))
-(define (make-renderer cameras ops)
- (%make-renderer (make-render-context) cameras ops))
-
(define (render renderer)
"Apply all of the render operations in RENDERER. The render
operations are applied once for each camera."
diff --git a/sly/render/scene.scm b/sly/render/scene.scm
index e2961a0..3249cc2 100644
--- a/sly/render/scene.scm
+++ b/sly/render/scene.scm
@@ -93,7 +93,7 @@ whether to draw the node and all of its children or not."
(set-identity! t)
-(define (scene->renderer node camera)
+(define (scene->renderer node context camera)
"Traverse the scene graph defined by NODE and its children, as seen
by CAMERA, and return a list of the render operations needed to
display the scene."
@@ -111,9 +111,11 @@ display the scene."
(map (cut iter <> transform)
(scene-node-children node))))
'())))
- (make-renderer (list camera) (flatten (iter node identity-transform))))
+ (make-renderer context
+ (list camera)
+ (flatten (iter node identity-transform))))
-(define (draw-scene node camera)
+(define (draw-scene node context camera)
"Draw the scene defined by NODE, as seen by CAMERA."
(apply-viewport (camera-viewport camera))
- (render (scene->renderer node camera)))
+ (render (scene->renderer node context camera)))