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