Each module now includes its own header first. Removed sstream.h and the definition...
[crack-attack.git] / src / obj_garbage_thick_edge.cxx
blob237ed8621968a7f09be16d8059f4ae6fc7c62e6b
1 /*
2 * garbage_thick_edge.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 edge of thick garbage.
28 #include <GL/glut.h>
30 #include "glext.h"
32 #include "Game.h"
33 #include "Displayer.h"
35 GLuint Displayer::garbage_thick_edge_list;
37 void Displayer::generateGarbageThickEdgeList ( )
39 garbage_thick_edge_list = glGenLists(1);
41 glEnableClientState(GL_VERTEX_ARRAY);
42 glEnableClientState(GL_NORMAL_ARRAY);
43 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
45 glNewList(garbage_thick_edge_list, GL_COMPILE);
47 GLfloat vertices_0[3 * 12] = {
48 1.0f, -1.0f, -1.0,
49 -1.0f, -1.0f, -1.0,
50 1.0f, 0.8, -1.0,
51 -1.0f, 0.8, -1.0,
52 1.0f, 1.0, -0.8,
53 -1.0f, 1.0, -0.8,
54 1.0f, 1.0, 0.8,
55 -1.0f, 1.0, 0.8,
56 1.0f, 0.8, 1.0,
57 -1.0f, 0.8, 1.0,
58 1.0f, -1.0f, 1.0,
59 -1.0f, -1.0f, 1.0
62 GLfloat normals_0[3 * 12] = {
63 0.0f, 0.0f, -1.0f,
64 0.0f, 0.0f, -1.0f,
65 0.0f, 0.0f, -1.0f,
66 0.0f, 0.0f, -1.0f,
67 0.0f, 1.0f, 0.0f,
68 0.0f, 1.0f, 0.0f,
69 0.0f, 1.0f, 0.0f,
70 0.0f, 1.0f, 0.0f,
71 0.0f, 0.0f, 1.0f,
72 0.0f, 0.0f, 1.0f,
73 0.0f, 0.0f, 1.0f,
74 0.0f, 0.0f, 1.0f
78 GLfloat tex_coords_0[3 * 12];
79 for (int n = 3 * 12; n--; )
80 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
82 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
83 glNormalPointer(GL_FLOAT, 0, normals_0);
84 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
85 glDrawArrays(GL_TRIANGLE_STRIP, 0, 12);
87 glEndList();
89 glDisableClientState(GL_VERTEX_ARRAY);
90 glDisableClientState(GL_NORMAL_ARRAY);
91 glDisableClientState(GL_TEXTURE_COORD_ARRAY);