(libload "opengl/glut")
(glut-init-window-size 400 400)
(glut-create-window "hello")

(glViewPort 0 0 400 400)
(glMatrixMode @GL_PROJECTION)
(glLoadIdentity)
(glOrtho -1.0  1.0  -1.0  1.0 1.5  20.0)

(glLightfv @GL_LIGHT0 @GL_POSITION [f 0.0 0.0 -5.0 0.0])
(glEnable @GL_LIGHTING)
(glEnable @GL_LIGHT0)
(glMaterialfv @GL_FRONT_AND_BACK @GL_DIFFUSE   [f 1  0  0 1])

(de display ()
  (glClear @GL_COLOR_BUFFER_BIT)
  (glColor3f 1 1 1)
  (glMatrixMode @GL_MODELVIEW)
  (glLoadIdentity)
  (gluLookAt 0 0 5   0 0 0   0 1 0)
  (glut-solid-teapot 0.3)
  (glFlush))

(dhc-make () display)
(glut-display-func (gptr display))
