Está en la página 1de 4

seis.

c 11/6/2020 11:12

1 #include <GL/glut.h>
2 #define ancho 640
3 #define alto 480
4 #define profundidad 500
5
6 void dibuja();
7 void ejes();
8 void tecladoNormal(unsigned char tecla, int x, int y);
9 void tecladoEspecial(int tecla, int x, int y);
10 void texto(int x, int y, char *palabra);
11 void desocupado();
12 void redimensionado(int width, int height);
13 void luces();
14 void crear_menu();
15 void menu(int opcion);
16 void menupoligono(int opcion);
17 void menutipo(int opcion);
18 void alterna_movimiento();
19 void alterna_pantalla();
20
21
22 int main(int argc, char** argv) {
23 glutInitDisplayMode(GLUT_STENCIL | GLUT_DOUBLE | GLUT_DEPTH);
24 glutInitWindowPosition(100, 0);
25 glutInitWindowSize(ancho, alto);
26 glutCreateWindow("Menu");
27 glOrtho(-(ancho/2), (ancho/2), -(alto/2), (alto/2), -profundi
28 glClearColor(1, 1, 1, 0);
29 crear_menu();
30 glutDisplayFunc(dibuja);
31 glutKeyboardFunc(tecladoNormal);
32 glutSpecialFunc(tecladoEspecial);
33 glutIdleFunc(desocupado);
34 glutReshapeFunc(redimensionado);
35 glutMainLoop();
36 return 0;
37 }

Page 1 of 4
seis.c 11/6/2020 11:12

38
39 void dibuja() {
40 glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_DEPT
41 ejes();
42 luces();
43 glPushMatrix();
44 glTranslatef(posx, posy, 0);
45 glRotatef(angulo, 1, 0, 0);
46 glRotatef(angulo, 0, 1, 0);
47 glRotatef(angulo, 0, 0, 1);
48 glScalef(esc, esc, esc);
49 glColor3f(1, 0, 0);
50 if(luz==1)
51 glEnable(GL_LIGHTING);
52 switch(figura) {
53 case 1: glutSolidTorus(
54 case 2: glutSolidSp
55 case 3: glutS
56 case
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

Page 2 of 4
seis.c 11/6/2020 11:12

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
103
104
105
106
107
108
109
110
111

Page 3 of 4
seis.c 11/6/2020 11:12

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

Page 4 of 4

También podría gustarte