- (begin-draw (length vertexes))
- (draw-vertexes vertexes)
- (glEnd))
-
-(define (begin-draw number-of-points)
- (cond ((= number-of-points 2) (glBegin GL_LINES))
- ((= number-of-points 3) (glBegin GL_TRIANGLES))
- ((= number-of-points 4) (glBegin GL_QUADS))
- ((> number-of-points 4) (glBegin GL_POLYGON))))
+ (gl-begin
+ (let ((number-of-points (length vertexes)))
+ (cond ((= number-of-points 2) (begin-mode lines))
+ ((= number-of-points 3) (begin-mode triangles))
+ ((= number-of-points 4) (begin-mode quads))
+ ((> number-of-points 4) (begin-mode polygon))))
+ (draw-vertexes vertexes)))