From e2a12e91f4a8c4ba2d0837cc65860f04fdb37991 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 29 Nov 2014 12:32:15 -0500 Subject: render: Define mesh in terms of model. * sly/render/mesh.scm (, %make-mesh, mesh?, mesh-vao, mesh-shader, mesh-texture): Delete. (make-mesh): Create a model object. --- sly/render/mesh.scm | 29 ++++------------------------- 1 file 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 - (%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 <>) 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))) -- cgit v1.2.3