1 1
2 2 #include "GL\glut.h"
3 3
4 4 void Render()
5 5 {
6 6 glClearColor(0.0, 0.0, 0.3, 0.0);
7 7 glClear(GL_COLOR_BUFFER_BIT);
8 8 glColor3f(1.0, 0.5, 0.5);
9 9 glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
10 10 glBegin(GL_POLYGON);
11 11 {
12 12 glVertex3f(0.5, 0.75, 0.0);
13 13 glVertex3f(0.8, 0.25, 0.0);
14 14 glVertex3f(0.2, 0.25, 0.0);
15 15 }
16 16 glEnd();
17 17
18 18 //glRectf(-0.5f,-0.5f,0.5f,0.5f);
19 19
20 20 glFlush();
21 21 }
22 22
23 23 int main( int argc, char * argv[] )
24 24 {
25 25 glutInit(&argc, argv);
26 26 glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
27 27 glutInitWindowPosition(100, 100);
28 28 glutInitWindowSize(400, 400);
29 29 glutCreateWindow("DoNeY's first OpenGL app");
30 30 glutDisplayFunc(&Render);
31 31 glutMainLoop();
32 32 return 0;
33 33 }
34 34
35