Updates for a new interface to the networking
[crack-attack.git] / src / obj_garbage_thick_middle.cxx
blob0c45c948d61f92e25e886820d571d0c2657617e8
1 /*
2 * garbage_thick_middle.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 middle 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_middle_list;
39 void Displayer::generateGarbageThickMiddleList ( )
41 garbage_thick_middle_list = glGenLists(1);
43 glEnableClientState(GL_VERTEX_ARRAY);
44 glEnableClientState(GL_NORMAL_ARRAY);
45 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
47 glNewList(garbage_thick_middle_list, GL_COMPILE);
49 GLfloat vertices_0[3 * 4] = {
50 1.0f, -1.0f, -1.0f,
51 -1.0f, -1.0f, -1.0f,
52 1.0f, 1.0f, -1.0f,
53 -1.0f, 1.0f, -1.0f
56 GLfloat vertices_1[3 * 4] = {
57 -1.0f, -1.0f, 1.0f,
58 1.0f, -1.0f, 1.0f,
59 -1.0f, 1.0f, 1.0f,
60 1.0f, 1.0f, 1.0f
63 GLfloat normals_0[3 * 4] = {
64 0.0f, 0.0f, -1.0f,
65 0.0f, 0.0f, -1.0f,
66 0.0f, 0.0f, -1.0f,
67 0.0f, 0.0f, -1.0f
70 GLfloat normals_1[3 * 4] = {
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
77 GLfloat tex_coords_0[3 * 4];
78 for (int n = 3 * 4; n--; )
79 tex_coords_0[n] = vertices_0[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
81 GLfloat tex_coords_1[3 * 4];
82 for (int n = 3 * 4; n--; )
83 tex_coords_1[n] = vertices_1[n] * DC_GARBAGE_LIGHTMAP_COORD_CONVERTER;
85 glVertexPointer(3, GL_FLOAT, 0, vertices_0);
86 glNormalPointer(GL_FLOAT, 0, normals_0);
87 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_0);
88 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
90 glVertexPointer(3, GL_FLOAT, 0, vertices_1);
91 glNormalPointer(GL_FLOAT, 0, normals_1);
92 glTexCoordPointer(3, GL_FLOAT, 0, tex_coords_1);
93 glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
95 glEndList();
97 glDisableClientState(GL_VERTEX_ARRAY);
98 glDisableClientState(GL_NORMAL_ARRAY);
99 glDisableClientState(GL_TEXTURE_COORD_ARRAY);