summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-11-09 19:56:41 -0500
committerDavid Thompson <dthompson2@worcester.edu>2015-11-09 19:56:41 -0500
commitf14a257d9c4be96d547d43860c7247ea3ff31cc3 (patch)
tree0ec5275c42cf40d40771348bcb9a6cbe82c1d555
parent9b4ec44a8e60e556f50da27b11f542a3993f2d03 (diff)
render: shape: Fix make-cube.
Forgot to update this one to the new rendering API. * sly/render/shape.scm (make-cube): Use render combinators.
-rw-r--r--sly/render/shape.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/sly/render/shape.scm b/sly/render/shape.scm
index 8e374b3..de4fd95 100644
--- a/sly/render/shape.scm
+++ b/sly/render/shape.scm
@@ -23,15 +23,16 @@
(define-module (sly render shape)
#:use-module (sly math)
+ #:use-module (sly render)
#:use-module (sly render mesh)
- #:use-module (sly render model)
- #:use-module (sly render shader)
#:use-module (sly render texture)
#:use-module (sly math vector)
#:export (make-cube))
-(define* (make-cube size #:optional #:key (texture #f)
- (shader (load-default-shader)))
+;; TODO: Write some combinators for composing triangles into more
+;; complex shapes with a procedure to convert them into a mesh.
+
+(define* (make-cube size #:optional #:key (texture #f))
(let* ((half-size (half size))
(mesh (build-mesh #(
;; Front
@@ -112,4 +113,5 @@
(vector2 s2 t1)
(vector2 s2 t2)
(vector2 s1 t2))))))
- (make-model #:mesh mesh #:texture texture #:shader shader)))
+ (with-texture texture
+ (render-mesh mesh))))