More glext-e fun. Do you love it? DO YA!!
[crack-attack.git] / src / obj_garbage_thin_cap.cxx
blob12d127a5e42fd49eab110f36aceaf8442c7b3932
1 /*
2 * garbage_thin_cap.cxx
3 * Daniel Nelson - 9/1/0
5 * Copyright (C) 2000 Daniel Nelson
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Daniel Nelson - aluminumangel.org
22 * 174 W. 18th Ave.
23 * Columbus, OH 43210
25 * Generates a display list for the cap of thin garbage.
28 #include <GL/glut.h>
30 #include "glext.h"
32 using namespace std;
34 #include "Game.h"
35 #include "Displayer.h"
37 GLuint Displayer::garbage_thin_cap_list;
39 void Displayer::generateGarbageThinCapList ( )
41 garbage_thin_cap_list = glGenLists(1);
43 glEnableClientState(GL_VERTEX_ARRAY);
44 glEnableClientState(GL_NORMAL_ARRAY);
45 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
47 glNewList(garbage_thin_cap_list, GL_COMPILE);
49 GLfloat vertices_0[3 * 18] = {
50 -0.8f, -0.8f, -1.0f,
51 1.0f, -0.8f, -1.0f,
52 -0.8f, -1.0f, -0.8f,
53 1.0f, -1.0f, -0.8f,
54 -0.8f, -1.0f, 0.8f,
55 1.0f, -1.0f, 0.8f,
56 -0.8f, -0.8f, 1.0f,
57 1.0f, -0.8f, 1.0f,
58 -0.8f, 0.8f, 1.0f,
59 1.0f, 0.8f, 1.0f,
60 -0.8f, 1.0f, 0.8f,
61 1.0f, 1.0f, 0.8f,
62 -0.8f, 1.0f, -0.8f,
63 1.0f, 1.0f, -0.8f,
64 -0.8f, 0.8f, -1.0f,
65 1.0f, 0.8f, -1.0f,
66 -0.8f, -0.8f, -1.0f,
67 1.0f, -0.8f, -1.0f
70 GLfloat vertices_1[3 * 8] = {
71 -0.8f, -0.8f, -1.0f,
72 -1.0f, -0.8f, -0.8f,
73 -0.8f, 0.8f, -1.0f,
74 -1.0f, 0.8f, -0.8f,
75 -0.8f, 1.0f, -0.8f,
76 -1.0f, 0.8f, 0.8f,
77 -0.8f, 1.0f, 0.8f,
78 -0.8f, 0.8f, 1.0f
81 GLfloat vertices_2[3 * 8] = {
82 -0.8f, 0.8f, 1.0f,
83 -1.0f, 0.8f, 0.8f,
84 -0.8f, -0.8f, 1.0f,
85 -1.0f, -0.8f, 0.8f,
86 -0.8f, -1.0f, 0.8f,
87 -1.0f, -0.8f, -0.8f,
88 -0.8f, -1.0f, -0.8f,
89 -0.8f, -0.8f, -1.0f
92 GLfloat vertices_3[3 * 4] = {
93 -1.0f, 0.8f, 0.8f,
94 -1.0f, 0.8f, -0.8f,
95 -1.0f, -0.8f, 0.8f,
96 -1.0f, -0.8f, -0.8f
99 GLfloat normals_0[3 * 18] = {
100 0.0f, 0.0f, -1.0f,
101 0.0f, 0.0f, -1.0f,
102 0.0f, -1.0f, 0.0f,
103 0.0f, -1.0f, 0.0f,
104 0.0f, -1.0f, 0.0f,
105 0.0f, -1.0f, 0.0f,
106 0.0f, 0.0f, 1.0f,
107 0.0f, 0.0f, 1.0f,
108 0.0f, 0.0f, 1.0f,
109 0.0f, 0.0f, 1.0f,
110 0.0f, 1.0f, 0.0f,
111 0.0f, 1.0f, 0.0f,
112 0.0f, 1.0f, 0.0f,
113 0.0f, 1.0f, 0.0f,
114 0.0f, 0.0f, -1.0f,
115 0.0f, 0.0f, -1.0f,
116 0.0f, 0.0f, -1.0f,
117 0.0f, 0.0f, -1.0f
120 GLfloat normals_1[3 * 8] = {
121 0.0f, 0.0f, -1.0f,
122 -1.0f, 0.0f, 0.0f,
123 0.0f, 0.0f, -1.0f,
124 -1.0f, 0.0f, 0.0f,
125 0.0f, 1.0f, 0.0f,
126 -1.0f, 0.0f, 0.0f,
127 0.0f, 1.0f, 0.0f,
128 0.0f, 0.0f, 1.0f
131 GLfloat normals_2[3 * 8] = {
132 0.0f, 0.0f, 1.0f,
133 -1.0f, 0.0f, 0.0f,
134 0.0f, 0.0f, 1.0f,
135 -1.0f, 0.0f, 0.0f,
136 0.0f, -1.0f, 0.0f,
137 -1.0f, 0.0f, 0.0f,
138 0.0f, -1.0f, 0.0f,
139 0.0f, 0.0f, -1.0f
142 GLfloat normals_3[3 * 4] = {
143 -1.0f, 0.0f, 0.0f,
144 -1.0f, 0.0f, 0.0f,
145 -1.0f, 0.0f, 0.0f,
146 -1.0f, 0.0f, 0.0f
149 GLfloat tex_coords_0[3 * 18];
150 for (int n = 3 * 18; n--; )
151 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
153 GLfloat tex_coords_1[3 * 8];
154 for (int n = 3 * 8; n--; )
155 tex_coords_1[n] = vertices_1[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
157 GLfloat tex_coords_2[3 * 8];
158 for (int n = 3 * 8; n--; )
159 tex_coords_2[n] = vertices_2[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
161 GLfloat tex_coords_3[3 * 4];
162 for (int n = 3 * 4; n--; )
163 tex_coords_3[n] = vertices_3[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
165 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
166 glNormalPointer(GL_FLOAT, 0, normals_0);
167 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
168 glDrawArrays(GL_TRIANGLE_STRIP, 0, 18);
170 glVertexPointer(3, GL_FLOAT, 0, vertices_1);
171 glNormalPointer(GL_FLOAT, 0, normals_1);
172 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_1);
173 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
175 glVertexPointer(3, GL_FLOAT, 0, vertices_2);
176 glNormalPointer(GL_FLOAT, 0, normals_2);
177 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_2);
178 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
180 glVertexPointer(3, GL_FLOAT, 0, vertices_3);
181 glNormalPointer(GL_FLOAT, 0, normals_3);
182 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_3);
183 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
185 glEndList();
187 glDisableClientState(GL_VERTEX_ARRAY);
188 glDisableClientState(GL_NORMAL_ARRAY);
189 glDisableClientState(GL_TEXTURE_COORD_ARRAY);