#include <GLUT/glut.h>

void idle() {
    glutPostRedisplay();
}

void display()
{
  glRotatef(0.1, 0,0,1);

  glClearColor(0.0, 0.0, 0.0, 1.0);
  glClear(GL_COLOR_BUFFER_BIT);
  glColor4f(0.0, 1.0, 0.0, 1.0);
  glBegin(GL_POLYGON);
  glVertex3f(0.25, 0.25, -0.5);
  glVertex3f(0.75, 0.25, -0.5);
  glVertex3f(0.75, 0.75, -0.5);
  glVertex3f(0.25, 0.75, -0.5);
  glEnd();
  glutSwapBuffers();
}

int main(int argc, char **argv)
{
  glutInit( &argc, argv );
  glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE);
  glutInitWindowSize( 640, 480 );
  glutCreateWindow( "glutTest3" );
  glutDisplayFunc( display );

  glutIdleFunc(idle);

  glutMainLoop();

  return 0;       // never reached
}

