标签:argv div flush main tin size code init pre
1 //Five edges polygon. 2 //As less code as possible. 3 4 #include "stdafx.h" 5 #include<gl/glut.h> 6 #include<stdlib.h> 7 8 void init(void) 9 { 10 glClearColor(0.0, 0.0, 0.0, 0.0); 11 } 12 13 void display(void) 14 { 15 glClear(GL_COLOR_BUFFER_BIT); 16 17 18 glBegin(GL_POLYGON); 19 glColor3f(1.0, 1.0, 1.0); 20 glVertex3f(-1.0, 0.0, 0.0); 21 22 glColor3f(1.0, 1.0, 0.0); 23 glVertex3f(0.0, 1.0, 0.0); 24 25 glColor3f(1.0, 0.0, 1.0); 26 glVertex3f(1.0, 0.0, 0.0); 27 28 glColor3f(0.0, 1.0, 1.0); 29 glVertex3f(0.5, -1.0, 0.0); 30 31 glColor3f(0.0, 0.0, 1.0); 32 glVertex3f(-0.5, -1.0, 0.0); 33 glEnd(); 34 glFlush(); 35 36 } 37 38 39 int main(int argc, char** argv) 40 { 41 glutInit(&argc, argv); 42 glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); 43 glutInitWindowPosition(500, 300); 44 glutInitWindowSize(500, 500); 45 glutCreateWindow("SimplePentage"); 46 init(); 47 glutDisplayFunc(display); 48 glutMainLoop(); 49 return 0; 50 }
标签:argv div flush main tin size code init pre
原文地址:http://www.cnblogs.com/turningpoint/p/6696767.html