/************************************************************* Simplest OpenGL Program H. Masterman 19 September 2000 modified every year since then, and in class ************************************************************/ #include // automatically includes GL.h and glu.h #include // added to include some extensions in freeglut #include // so we can do some output to the console using namespace std; //so we can use cout function void myinit(void) { /* Set up attributes */ glClearColor(0.0, 0.0, 0.0, 0.0); /* black background */ /* set up viewing projection*/ /* 500 x 500 window with origin lower left */ glMatrixMode(GL_PROJECTION); //set up camera for parallel (orthographic) projection glLoadIdentity(); glOrtho(0.0, 500.0, 0.0, 500.0,0.0, 500.0); // set up 500 x 500 coordinate system glMatrixMode(GL_MODELVIEW); //restore matrix pointer to MODELVIEW } void display( void ) { glClear(GL_COLOR_BUFFER_BIT); //clear the window //set attributes glColor3f(1.0, 0.0, 0.0); // set color glLineWidth(1.0); glPointSize(4.0); //draw a polygon in immediate mode glBegin(GL_POLYGON); glVertex2f(250, 250); glVertex2f(100,100); glVertex2f(375, 56); glEnd(); //print some text information to the console cout<<"executing display()"<