From: Javier Sancho Date: Tue, 9 Oct 2012 16:42:15 +0000 (+0200) Subject: New picture mesh using resources cache X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=6ecc92491ec58e41fc41e3620f2e7cc6bd1534e6;p=gacela.git New picture mesh using resources cache --- diff --git a/src/video.scm b/src/video.scm index d19796e..a9db7be 100644 --- a/src/video.scm +++ b/src/video.scm @@ -564,18 +564,6 @@ ;;; Primitives -(define-macro (define-mesh header . body) - (let ((name (car header)) - (args (cdr header))) - `(define* ,header - (let ((m (make-mesh - ',name - (lambda (props) - (apply (lambda* ,args ,@body) - ((@ (gacela utils) arguments-apply) ,name props)))))) - (mesh-properties-set! m (list ,@(map (lambda (a) `(cons ',a ,a)) (names-arguments args)))) - m)))) - (define-macro (primitive header . body) (let* ((type (car header)) (args (cdr header)) @@ -607,8 +595,8 @@ (define-primitive (rectangle width height #:key texture color texture-coord) (draw-rectangle width height #:texture texture #:color color #:texture-coord texture-coord)) -(define-primitive (texture texture #:key (zoom 1) (sprite '((0 0) (1 1)))) - (draw-texture texture #:zoom zoom #:sprite sprite)) +(define-primitive (picture filename #:key (min-filter GL_LINEAR) (mag-filter GL_LINEAR) (zoom 1) (sprite '((0 0) (1 1)))) + (draw-texture (load-texture filename #:min-filter min-filter #:mag-filter mag-filter) #:zoom zoom #:sprite sprite)) (module-map (lambda (sym var)