]> git.jsancho.org Git - gacela.git/blobdiff - src/gacela_draw.scm
(no commit message)
[gacela.git] / src / gacela_draw.scm
index 5290dc490e5a661af069ee78d208b02417ed3342..f72c75142ecc314c7cb6adf98dd4e0a93c6c6d28 100644 (file)
@@ -39,7 +39,8 @@
   (glEnd))
 
 (define (begin-draw number-of-points)
-  (cond ((= number-of-points 3) (glBegin GL_TRIANGLES))
+  (cond ((= number-of-points 2) (glBegin GL_LINES))
+       ((= number-of-points 3) (glBegin GL_TRIANGLES))
        ((= number-of-points 4) (glBegin GL_QUADS))))
 
 (define (draw-vertexes vertexes)
               (height (texture-h texture)))
           (draw-rectangle (* zoom width) (* zoom height) #:texture texture)))))
 
+(define* (draw-line length #:optional color)
+  (let ((l (/ length 2)))
+    (cond (color
+          (with-color color (draw (list 0 l) (list 0 (- l)))))
+         (else
+          (draw (list 0 l) (list 0 (- l)))))))
+
 (define* (draw-quad v1 v2 v3 v4 #:key texture color)
   (cond (texture
         (progn-textures