#!/usr/local/bin/perl
#
# simple example taken from listing 1-1 (or 1-2) from OpenGL book
#

# Uncomment this to run the example without installing the
# built modules. 

#sub BEGIN
#  {
#    push @INC, ("./OpenGL",
#                "./OpenGL/blib/arch",
#                "./OpenGLU",
#                "./OpenGLU/blib/arch",
#                "./GLUT",
#                "./GLUT/blib/arch");
#  }

use OpenGL;
use OpenGLU;
use GLUT;

glutInit;
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutCreateWindow("very simple");
glClearColor(0,0,1,1);
glColor3f(1,0,0);
glutDisplayFunc(\&display);
glutMainLoop();

sub display
{
 glClear(GL_COLOR_BUFFER_BIT);
 glBegin(GL_POLYGON);
   glVertex2f(-0.5,-0.5);
   glVertex2f(-0.5, 0.5);
   glVertex2f( 0.5, 0.5);
   glVertex2f( 0.5,-0.5);
 glEnd();
 glFlush();
}
