(bind-func glCube
(let ((dlist -1))
(lambda ()
(if (> dlist -1)
(begin (glCallList dlist) 1)
(begin (set! dlist (glGenLists 1))
(glNewList dlist (+ GL_COMPILE 1))
(glBegin GL_QUADS)
;; Front face
(glNormal3d 0.0 0.0 1.0)
(glVertex3d 0.0 0.0 1.0)
(glVertex3d 1.0 0.0 1.0)
(glVertex3d 1.0 1.0 1.0)
(glVertex3d 0.0 1.0 1.0)
;; Back face
(glNormal3d 0.0 0.0 -1.0)
(glVertex3d 0.0 0.0 0.0)
(glVertex3d 0.0 1.0 0.0)
(glVertex3d 1.0 1.0 0.0)
(glVertex3d 1.0 0.0 0.0)
;; Top face
(glNormal3d 0.0 1.0 0.0)
(glVertex3d 0.0 1.0 0.0)
(glVertex3d 0.0 1.0 1.0)
(glVertex3d 1.0 1.0 1.0)
(glVertex3d 1.0 1.0 0.0)
;; Bottom face
(glNormal3d 0.0 -1.0 0.0)
(glVertex3d 0.0 0.0 0.0)
(glVertex3d 1.0 0.0 0.0)
(glVertex3d 1.0 0.0 1.0)
(glVertex3d 0.0 0.0 1.0)
;; Right face
(glNormal3d 1.0 0.0 0.0)
(glVertex3d 1.0 0.0 0.0)
(glVertex3d 1.0 1.0 0.0)
(glVertex3d 1.0 1.0 1.0)
(glVertex3d 1.0 0.0 1.0)
;; Left face
(glNormal3d -1.0 0.0 0.0)
(glVertex3d 0.0 0.0 0.0)
(glVertex3d 0.0 0.0 1.0)
(glVertex3d 0.0 1.0 1.0)
(glVertex3d 0.0 1.0 0.0)
(glEnd)
(glEndList)
1)))))