More glext-e fun. Do you love it? DO YA!!
[crack-attack.git] / src / obj_garbage_thick_corner.cxx
blobb06bcd0132fca601d8bc5f99666dd4b9fab1d1a3
1 /*
2 * garbage_thick_corner.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 corner of thick 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_thick_corner_list;
39 void Displayer::generateGarbageThickCornerList ( )
41 garbage_thick_corner_list = glGenLists(1);
43 glEnableClientState(GL_VERTEX_ARRAY);
44 glEnableClientState(GL_NORMAL_ARRAY);
45 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
47 glNewList(garbage_thick_corner_list, GL_COMPILE);
49 GLfloat vertices_0[3 * 12] =
51 1.0f, -1.0f, -1.0f,
52 -0.8f, -1.0f, -1.0f,
53 1.0f, 0.8f, -1.0f,
54 -0.8f, 0.8f, -1.0f,
55 1.0f, 1.0f, -0.8f,
56 -0.8f, 1.0f, -0.8f,
57 1.0f, 1.0f, 0.8f,
58 -0.8f, 1.0f, 0.8f,
59 1.0f, 0.8f, 1.0f,
60 -0.8f, 0.8f, 1.0f,
61 1.0f, -1.0f, 1.0f,
62 -0.8f, -1.0f, 1.0f
65 GLfloat vertices_1[3 * 8] =
67 -0.8f, -1.0f, -1.0f,
68 -1.0f, -1.0f, -0.8f,
69 -0.8f, 0.8f, -1.0f,
70 -1.0f, 0.8f, -0.8f,
71 -0.8f, 1.0f, -0.8f,
72 -1.0f, 0.8f, 0.8f,
73 -0.8f, 1.0f, 0.8f,
74 -0.8f, 0.8f, 1.0f
77 GLfloat vertices_2[3 * 6] =
79 -1.0f, 0.8f, -0.8f,
80 -1.0f, -1.0f, -0.8f,
81 -1.0f, 0.8f, 0.8f,
82 -1.0f, -1.0f, 0.8f,
83 -0.8f, 0.8f, 1.0f,
84 -0.8f, -1.0f, 1.0f
87 GLfloat normals_0[3 * 12] =
89 0.0f, 0.0f, -1.0f,
90 0.0f, 0.0f, -1.0f,
91 0.0f, 0.0f, -1.0f,
92 0.0f, 0.0f, -1.0f,
93 0.0f, 1.0f, 0.0f,
94 0.0f, 1.0f, 0.0f,
95 0.0f, 1.0f, 0.0f,
96 0.0f, 1.0f, 0.0f,
97 0.0f, 0.0f, 1.0f,
98 0.0f, 0.0f, 1.0f,
99 0.0f, 0.0f, 1.0f,
100 0.0f, 0.0f, 1.0f
103 GLfloat normals_1[3 * 8] =
105 0.0f, 0.0f, -1.0f,
106 -1.0f, 0.0f, 0.0f,
107 0.0f, 0.0f, -1.0f,
108 -1.0f, 0.0f, 0.0f,
109 0.0f, 1.0f, 0.0f,
110 -1.0f, 0.0f, 0.0f,
111 0.0f, 1.0f, 0.0f,
112 0.0f, 0.0f, 1.0f
115 GLfloat normals_2[3 * 6] =
117 -1.0f, 0.0f, 0.0f,
118 -1.0f, 0.0f, 0.0f,
119 -1.0f, 0.0f, 0.0f,
120 -1.0f, 0.0f, 0.0f,
121 0.0f, 0.0f, 1.0f,
122 0.0f, 0.0f, 1.0f
125 GLfloat tex_coords_0[3 * 12];
126 for (int n = 3 * 12; n--; )
127 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
129 GLfloat tex_coords_1[3 * 8];
130 for (int n = 3 * 8; n--; )
131 tex_coords_1[n] = vertices_1[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
133 GLfloat tex_coords_2[3 * 6];
134 for (int n = 3 * 6; n--; )
135 tex_coords_2[n] = vertices_2[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
137 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
138 glNormalPointer(GL_FLOAT, 0, normals_0);
139 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
140 glDrawArrays(GL_TRIANGLE_STRIP, 0, 12);
142 glVertexPointer(3, GL_FLOAT, 0, vertices_1);
143 glNormalPointer(GL_FLOAT, 0, normals_1);
144 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_1);
145 glDrawArrays(GL_TRIANGLE_STRIP, 0, 8);
147 glVertexPointer(3, GL_FLOAT, 0, vertices_2);
148 glNormalPointer(GL_FLOAT, 0, normals_2);
149 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_2);
150 glDrawArrays(GL_TRIANGLE_STRIP, 0, 6);
152 glEndList();
154 glDisableClientState(GL_VERTEX_ARRAY);
155 glDisableClientState(GL_NORMAL_ARRAY);
156 glDisableClientState(GL_TEXTURE_COORD_ARRAY);