- (progn-textures
- (glBindTexture GL_TEXTURE_2D (getf (get-resource texture) :id-texture))
- (begin-draw 4)
- (draw-vertex v1 :texture-coord '(0 0))
- (draw-vertex v2 :texture-coord '(1 0))
- (draw-vertex v3 :texture-coord '(1 1))
- (draw-vertex v4 :texture-coord '(0 1))
- (glEnd)))
- (t (draw v1 v2 v3 v4))))
+ (let ((width (getf (get-resource texture) :width))
+ (height (getf (get-resource texture) :height)))
+ (draw-rectangle (* zoom width) (* zoom height) :texture texture)))))
+
+(defun draw-quad (v1 v2 v3 v4 &key texture)
+ (let ((id-texture (getf (get-resource texture) :id-texture)))
+ (cond (id-texture
+ (progn-textures
+ (glBindTexture GL_TEXTURE_2D id-texture)
+ (begin-draw 4)
+ (draw-vertex v1 :texture-coord '(0 0))
+ (draw-vertex v2 :texture-coord '(1 0))
+ (draw-vertex v3 :texture-coord '(1 1))
+ (draw-vertex v4 :texture-coord '(0 1))
+ (glEnd)))
+ ((consp texture) (with-color texture (draw v1 v2 v3 v4)))
+ (t (draw v1 v2 v3 v4)))))