]> git.jsancho.org Git - gacela.git/blobdiff - gacela_draw.lisp
(no commit message)
[gacela.git] / gacela_draw.lisp
index fd2a7174d8ed7eabf7c5fd591565251e9cd25381..4b6f58fb126ec746a7c6b0b9d995226ae29bc03e 100644 (file)
 (in-package :gacela)
 
 (defmacro with-color (color &body code)
-  `(let ((original-color (get-current-color)))
-     (apply #'set-current-color ,color)
-     ,@code
-     (apply #'set-current-color original-color)))
+  (cond (color
+        `(let ((original-color (get-current-color)))
+           (apply #'set-current-color ,color)
+           ,@code
+           (apply #'set-current-color original-color)))
+       (t
+        `(progn
+           ,@code))))
 
 (defmacro progn-textures (&body code)
   `(let (values)
               (draw-rectangle (* f width) (* f height) :texture texture)))))))
 
 (defun draw-quad (v1 v2 v3 v4 &key texture)
-  (cond (texture
+  (cond ((consp texture) (with-color texture (draw v1 v2 v3 v4)))
+       (texture
         (progn-textures
          (glBindTexture GL_TEXTURE_2D (getf (get-resource texture) :id-texture))
          (begin-draw 4)