summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-11-29 12:32:15 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-11-29 12:32:15 -0500
commite2a12e91f4a8c4ba2d0837cc65860f04fdb37991 (patch)
tree8d60196debfd3115b1c5f4ad35d47dac543b0062
parent0418c29a160f4c908d76bd19ebeb40571f3d60d4 (diff)
render: Define mesh in terms of model.
* sly/render/mesh.scm (<mesh>, %make-mesh, mesh?, mesh-vao, mesh-shader, mesh-texture): Delete. (make-mesh): Create a model object.
-rw-r--r--sly/render/mesh.scm29
1 files changed, 4 insertions, 25 deletions
diff --git a/sly/render/mesh.scm b/sly/render/mesh.scm
index 0f6a2b0..992ef85 100644
--- a/sly/render/mesh.scm
+++ b/sly/render/mesh.scm
@@ -37,30 +37,9 @@
#:use-module (sly math transform)
#:use-module (sly render utils)
#:use-module (sly render vertex-array)
- #:use-module (sly render renderer)
- #:export (make-mesh
- mesh?
- mesh-shader
- mesh-texture))
-
-;;;
-;;; Mesh
-;;;
-
-(define-record-type <mesh>
- (%make-mesh vao shader texture)
- mesh?
- (vao mesh-vao)
- (shader mesh-shader)
- (texture mesh-texture))
+ #:use-module (sly render model)
+ #:export (make-mesh))
(define* (make-mesh #:optional #:key shader texture indices positions textures)
- (%make-mesh (make-vertex-array indices positions textures)
- shader texture))
-
-(define-method (draw (mesh <<mesh>>) transform)
- (make-render-op #:vertex-array (mesh-vao mesh)
- #:texture (mesh-texture mesh)
- #:shader (mesh-shader mesh)
- #:transform transform
- #:uniforms `(("color" ,white))))
+ (make-model #:shader shader #:texture texture
+ #:mesh (make-vertex-array indices positions textures)))