From c04b4b1ea000410c8fa64834043f7361dd7a7460 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 16 Jun 2013 14:32:50 -0400 Subject: Add a color parameter to texture-quad. --- 2d/texture.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '2d') diff --git a/2d/texture.scm b/2d/texture.scm index 2081670..50ac21e 100644 --- a/2d/texture.scm +++ b/2d/texture.scm @@ -71,12 +71,13 @@ Currently only works with RGBA format surfaces." "Loads a texture from a file." (surface->texture (SDL:load-image filename))) -(define* (texture-quad texture x y w h) +(define* (texture-quad texture x y w h #:optional (color '(1 1 1))) "Renders a textured quad." (let ((x2 (+ x w)) (y2 (+ y h))) (with-gl-bind-texture (texture-target texture-2d) (texture-id texture) (gl-begin (begin-mode quads) + (apply gl-color color) (gl-texture-coordinates 0 0) (gl-vertex x y) (gl-texture-coordinates 1 0) -- cgit v1.2.3