include


#
pragmacomment(lib,"glut32.lib")

#
pragmacomment(lib,"opengl32.lib")

intwidth=480,hight=640;

voiddisplay(void)/* all of our code that need tosee in screen shouldwrite in this function and betweenglClear(GL_color_BUFFER_BIT)andglutSwapBuffers()*/

{

glClear(GL_COLOR_BUFFER_BIT);

glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

glColor3f(2.0,0.0,2.0);//orglColor4f(2.0,0.0,2.0,0.2) 4thparameter fortransparencyoption

glBegin(GL_TRIANGLE_FAN);

glVertex2f(-0.0, 0.0);

glVertex2f(-0.7,0.0);

glVertex2f(-0.7, 0.7);

glVertex2f(0.0,0.7);

glVertex2f(0.7, 0.7);

glVertex2f(0.7,0.0);

glVertex2f(0.7, -0.7);

glVertex2f(0.0,-0.7);

glVertex2f(-0.7, -0.7);

glEnd();

glutSwapBuffers();

}

intmain(intargc,char **argv)

{

glutInit(&argc, argv);

glutInitDisplayMode(GLUT_DOUBLE);

glutInitWindowSize(width, hight);//the resolution of screen

glutCreateWindow("HelloOpenGLWorld");//name ofscreen

glutDisplayFunc(display);//go to displayfunction

glutMainLoop();

}