summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2018-08-28 08:58:35 -0400
committerDavid Thompson <dthompson2@worcester.edu>2018-08-28 08:58:35 -0400
commit2eda5f3e5cc16ca9808d5a0e8326bcf1716796c6 (patch)
treefd19c49770e7a0a1d19abb5e0ee1d7e39f82afaa
parent039a1d8d19aa72c4c39b709bc360905651de0456 (diff)
Remove viewport from camera.
Clearing viewports for each camera render made it impossible to compose canvases.
-rw-r--r--starling/node-2d.scm23
1 files changed, 5 insertions, 18 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index d0be0a2..c0cb243 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -157,28 +157,15 @@
(define-class <view-2d> ()
(camera #:accessor camera #:init-keyword #:camera)
- (area #:getter area #:init-keyword #:area)
- (viewport #:accessor viewport))
-
-(define-method (initialize (view <view-2d>) initargs)
- (define (to-int x)
- (inexact->exact (round x)))
- (next-method)
- (let ((r (area view)))
- (set! (viewport view)
- (make-viewport (to-int (rect-x r))
- (to-int (rect-y r))
- (to-int (rect-width r))
- (to-int (rect-height r))))))
+ (area #:getter area #:init-keyword #:area))
(define %identity-matrix (make-identity-matrix4))
(define-method (render (view <view-2d>))
- (with-viewport (viewport view)
- (with-projection (projection-matrix (camera view))
- (draw-sprite* (framebuffer-texture (framebuffer (camera view)))
- (area view)
- %identity-matrix))))
+ (with-projection (projection-matrix (camera view))
+ (draw-sprite* (framebuffer-texture (framebuffer (camera view)))
+ (area view)
+ %identity-matrix)))
;;;