3 * Daniel Nelson - 9/1/0
5 * Copyright (C) 2000 Daniel Nelson
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
25 * Generates a display list for the cap of thin garbage.
38 #include "Displayer.h"
40 GLuint
Displayer::garbage_thin_cap_list
;
42 void Displayer::generateGarbageThinCapList ( )
44 garbage_thin_cap_list
= glGenLists(1);
46 glEnableClientState(GL_VERTEX_ARRAY
);
47 glEnableClientState(GL_NORMAL_ARRAY
);
48 glEnableClientState(GL_TEXTURE_COORD_ARRAY
);
50 glNewList(garbage_thin_cap_list
, GL_COMPILE
);
52 GLfloat vertices_0
[3 * 18] = {
73 GLfloat vertices_1
[3 * 8] = {
84 GLfloat vertices_2
[3 * 8] = {
95 GLfloat vertices_3
[3 * 4] = {
102 GLfloat normals_0
[3 * 18] = {
123 GLfloat normals_1
[3 * 8] = {
134 GLfloat normals_2
[3 * 8] = {
145 GLfloat normals_3
[3 * 4] = {
152 GLfloat tex_coords_0
[3 * 18];
153 for (int n
= 3 * 18; n
--; )
154 tex_coords_0
[n
] = vertices_0
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
156 GLfloat tex_coords_1
[3 * 8];
157 for (int n
= 3 * 8; n
--; )
158 tex_coords_1
[n
] = vertices_1
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
160 GLfloat tex_coords_2
[3 * 8];
161 for (int n
= 3 * 8; n
--; )
162 tex_coords_2
[n
] = vertices_2
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
164 GLfloat tex_coords_3
[3 * 4];
165 for (int n
= 3 * 4; n
--; )
166 tex_coords_3
[n
] = vertices_3
[n
] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER
;
168 glVertexPointer(3, GL_FLOAT
, 0, vertices_0
);
169 glNormalPointer(GL_FLOAT
, 0, normals_0
);
170 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_0
);
171 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 18);
173 glVertexPointer(3, GL_FLOAT
, 0, vertices_1
);
174 glNormalPointer(GL_FLOAT
, 0, normals_1
);
175 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_1
);
176 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 8);
178 glVertexPointer(3, GL_FLOAT
, 0, vertices_2
);
179 glNormalPointer(GL_FLOAT
, 0, normals_2
);
180 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_2
);
181 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 8);
183 glVertexPointer(3, GL_FLOAT
, 0, vertices_3
);
184 glNormalPointer(GL_FLOAT
, 0, normals_3
);
185 glTexCoordPointer(3, GL_FLOAT
, 0, tex_coords_3
);
186 glDrawArrays(GL_TRIANGLE_STRIP
, 0, 4);
190 glDisableClientState(GL_VERTEX_ARRAY
);
191 glDisableClientState(GL_NORMAL_ARRAY
);
192 glDisableClientState(GL_TEXTURE_COORD_ARRAY
);