-
Notifications
You must be signed in to change notification settings - Fork 0
/
output2.c
102 lines (73 loc) · 1.78 KB
/
output2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//white rectangle with red diagonal stripes, with background color blue
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
void display(){
glClearColor(0.0,0.0,1.0,0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(0.0,1.0,0.0);
glColor3f(1.0f, 1.0f, 1.0f);
glRectf(-0.50f, 0.75f, 0.50f, -0.75f);
glFlush();
glutSwapBuffers();
glBegin(GL_LINE_STRIP);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glPointSize(2.0);
glVertex2f(-.50,.75);
glVertex2f(-.50,.75);
glVertex2f(-.50,.60);
glVertex2f(-.40,.75);
glVertex2f(-.50,.45);
glVertex2f(-.30,.75);
glVertex2f(-.50,.30);
glVertex2f(-.20,.75);
glVertex2f(-.50,.15);
glVertex2f(-10,.75);
glVertex2f(-.50,.00);
glVertex2f(-.00,.75);
glVertex2f(-.50,-.00);
glVertex2f(.00,.75);
glVertex2f(-.50,-.15);
glVertex2f(.10,.75);
glVertex2f(-.50,-.30);
glVertex2f(.20,.75);
glVertex2f(-.50,-.45);
glVertex2f(.30,.75);
glVertex2f(-.50,-.60);
glVertex2f(.40,.75);
glVertex2f(-.50,-.75);
glVertex2f(.50,.75);
glVertex2f(-.40,-.75);
glVertex2f(.50,.65);
glVertex2f(-.30,-.75);
glVertex2f(.50,.50);
glVertex2f(-.20,-.75);
glVertex2f(.50,.25);
glVertex2f(-.10,-.75);
glVertex2f(.50,.15);
glVertex2f(-.00,-.75);
glVertex2f(.50,.0);
glVertex2f(.10,-.75);
glVertex2f(.50,-.15);
glVertex2f(.20,-.75);
glVertex2f(.50,-.30);
glVertex2f(.30,-.75);
glVertex2f(.50,-.45);
glVertex2f(.40,-.75);
glVertex2f(.50,-.60);
glVertex2f(.50,-.75);
glVertex2f(.50,-.75);
glEnd();
glFlush();
}
int main(int argc, char *argv[]){
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
glutInitWindowSize(800, 800);
glutInitWindowPosition(200, 100);
glutCreateWindow("Lab Test");
glutDisplayFunc(display);
glutMainLoop();
return 0;
}