opengl-intro: trikotnik.c
File trikotnik.c, 486 bytes (added by , 16 years ago) |
---|
Line | |
---|---|
1 | #include <GL/glut.h> |
2 | |
3 | void display() |
4 | { |
5 | glClear(GL_COLOR_BUFFER_BIT); |
6 | glBegin(GL_TRIANGLES); |
7 | glColor3f(1.0, 0.0, 0.0); |
8 | glVertex2f(-1.0, -1.0); |
9 | glColor3f(0.0, 1.0, 0.0); |
10 | glVertex2f(0.0, 1.0); |
11 | glColor3f(0.0, 0.0, 1.0); |
12 | glVertex2f(1.0, 0.0); |
13 | glEnd(); |
14 | glFlush(); |
15 | } |
16 | |
17 | |
18 | int main(int argc, char *argv[]) |
19 | { |
20 | glutInit(&argc,argv); |
21 | glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); |
22 | glutCreateWindow("C GLUT program"); |
23 | glutDisplayFunc(display); |
24 | glutMainLoop(); |
25 | return 0; |
26 | } |