#include <GL/gl.h>
#include <GL/glut.h>

static int win;

void init(int argc, char **argv)
{
 // initialize glut
 glutInit(&argc, argv);
 // specify the display mode to be RGB and single buffering 
 // we use single buffering since this will be non animated
 glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE);
 // define the size
 glutInitWindowSize(500,500);
 // the position where the window will appear
 glutInitWindowPosition(100,100);
 // if we would want fullscreen:
 // glutFullScreen();
 // create the window, set the title and keep the 
 // window identifier.
 win = glutCreateWindow("Title goes here");
 //glutDisplayFunc(disp);
 //glutKeyboardFunc(keyb);
}

int main(int argc, char **argv){
 // init GLUT to handle window
 init(argc,argv);

 // opengl code (performed only on startup)
 // set clear-colour
 glClearColor(0,0,0,0);
 // clear display to clear-colour
 glClear(GL_COLOR_BUFFER_BIT);
 // set draw-colour
 glColor3f(1,1,1);
 // specify co-ordinate system (mapping image to screen)
 glOrtho(-1, 1,-1, 1,-1, 1);
 // begin defining a new object (polygon)
 glBegin(GL_POLYGON);
  // define polygon's corners ()
  glVertex2f(-0.5, -0.5);
  glVertex2f(-0.5, 0.5);
  glVertex2f(0.5, 0.5);
  glVertex2f(0.5, -0.5);
 // end defining object
 glEnd();
 // output commands to screen
 glFlush();

 // use GLUT to run main loop
 glutMainLoop();
 return 0;
}
