|
@@ -1,186 +0,0 @@
|
1
|
|
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
|
2
|
|
-/*================================================================
|
3
|
|
- *
|
4
|
|
- * Project : UnRaider
|
5
|
|
- * Author : Terry 'Mongoose' Hendrix II
|
6
|
|
- * Website : http://www.westga.edu/~stu7440/
|
7
|
|
- * Email : stu7440@westga.edu
|
8
|
|
- * Object : GLUTSystem
|
9
|
|
- * License : No use w/o permission (C) 2002 Mongoose
|
10
|
|
- * Comments:
|
11
|
|
- *
|
12
|
|
- *
|
13
|
|
- * This file was generated using Mongoose's C++
|
14
|
|
- * template generator script. <stu7440@westga.edu>
|
15
|
|
- *
|
16
|
|
- *-- History -------------------------------------------------
|
17
|
|
- *
|
18
|
|
- * 2002.08.09:
|
19
|
|
- * Mongoose - Created
|
20
|
|
- =================================================================*/
|
21
|
|
-
|
22
|
|
-#include <stdlib.h>
|
23
|
|
-#include <stdio.h>
|
24
|
|
-#include <string.h>
|
25
|
|
-
|
26
|
|
-#ifdef __APPLE__
|
27
|
|
-#include <OpenGL/gl.h>
|
28
|
|
-#include <OpenGL/glu.h>
|
29
|
|
-#include <GLUT/glut.h>
|
30
|
|
-#else
|
31
|
|
-#include <GL/gl.h>
|
32
|
|
-#include <GL/glu.h>
|
33
|
|
-#include <GL/glut.h>
|
34
|
|
-#endif
|
35
|
|
-
|
36
|
|
-#ifdef PS2_LINUX
|
37
|
|
-# include "ps2.h"
|
38
|
|
-#endif
|
39
|
|
-
|
40
|
|
-#include "GLUTSystem.h"
|
41
|
|
-
|
42
|
|
-
|
43
|
|
-// Mongoose 2003.06.03, Updated to modern times since the wheel
|
44
|
|
-// was invented, no longer propagate crap up to System
|
45
|
|
-GLUTSystem gGlutSystem;
|
46
|
|
-
|
47
|
|
-
|
48
|
|
-////////////////////////////////////////////////////////////
|
49
|
|
-// Constructors
|
50
|
|
-////////////////////////////////////////////////////////////
|
51
|
|
-
|
52
|
|
-GLUTSystem::GLUTSystem() : System()
|
53
|
|
-{
|
54
|
|
-}
|
55
|
|
-
|
56
|
|
-
|
57
|
|
-GLUTSystem::~GLUTSystem()
|
58
|
|
-{
|
59
|
|
-}
|
60
|
|
-
|
61
|
|
-
|
62
|
|
-////////////////////////////////////////////////////////////
|
63
|
|
-// Public Accessors
|
64
|
|
-////////////////////////////////////////////////////////////
|
65
|
|
-
|
66
|
|
-
|
67
|
|
-////////////////////////////////////////////////////////////
|
68
|
|
-// Public Mutators
|
69
|
|
-////////////////////////////////////////////////////////////
|
70
|
|
-
|
71
|
|
-void display(void)
|
72
|
|
-{
|
73
|
|
- gGlutSystem.gameFrame();
|
74
|
|
-}
|
75
|
|
-
|
76
|
|
-
|
77
|
|
-void reshape(int w, int h)
|
78
|
|
-{
|
79
|
|
- gGlutSystem.resizeGL(w, h);
|
80
|
|
-}
|
81
|
|
-
|
82
|
|
-
|
83
|
|
-void key(unsigned char k, int x, int y)
|
84
|
|
-{
|
85
|
|
- gGlutSystem.handleKeyEvent(k, 0);
|
86
|
|
-}
|
87
|
|
-
|
88
|
|
-
|
89
|
|
-void special(int key, int x, int y)
|
90
|
|
-{
|
91
|
|
- gGlutSystem.handleKeyEvent(key, 0);
|
92
|
|
-}
|
93
|
|
-
|
94
|
|
-
|
95
|
|
-void GLUTSystem::shutdown(int i)
|
96
|
|
-{
|
97
|
|
- //#ifdef DEBUG_MEMEORY
|
98
|
|
- //printf("[Mongoose MEMEORY_DEBUG]\nUnfreed memory table:\n");
|
99
|
|
- //dump_memory_report();
|
100
|
|
- //#endif
|
101
|
|
-
|
102
|
|
- printf("\n\n\tThanks for testing %s\n", VERSION);
|
103
|
|
- printf("\tPlease file bug reports and submit video card performance\n\n");
|
104
|
|
- printf("\tBuild date : %s @ %s\n", __DATE__, __TIME__);
|
105
|
|
- printf("\tBuild host : %s\n", BUILD_HOST);
|
106
|
|
- printf("\tEmail bugs : mongoose@users.sourceforge.net\n");
|
107
|
|
- printf("\tWeb site : http://openraider.sourceforge.net\n\n");
|
108
|
|
-
|
109
|
|
- exit(0);
|
110
|
|
-}
|
111
|
|
-
|
112
|
|
-
|
113
|
|
-void GLUTSystem::initVideo(unsigned int width, unsigned int height,
|
114
|
|
- bool fullscreen)
|
115
|
|
-{
|
116
|
|
- glutInit(NULL, 0);
|
117
|
|
- printf("@Created OpenGL Context...\n");
|
118
|
|
-
|
119
|
|
- m_width = width;
|
120
|
|
- m_height = height;
|
121
|
|
-
|
122
|
|
- if (fullscreen)
|
123
|
|
- {
|
124
|
|
- }
|
125
|
|
-
|
126
|
|
- glutReshapeFunc(reshape);
|
127
|
|
- glutDisplayFunc(display);
|
128
|
|
- glutKeyboardFunc(key);
|
129
|
|
- glutSpecialFunc(special);
|
130
|
|
-
|
131
|
|
- // Start game renderer
|
132
|
|
- initGL();
|
133
|
|
-
|
134
|
|
- // Resize context
|
135
|
|
- resizeGL(width, height);
|
136
|
|
-}
|
137
|
|
-
|
138
|
|
-
|
139
|
|
-void GLUTSystem::runGame()
|
140
|
|
-{
|
141
|
|
- glutMainLoop();
|
142
|
|
-}
|
143
|
|
-
|
144
|
|
-
|
145
|
|
-void GLUTSystem::toggleFullscreen()
|
146
|
|
-{
|
147
|
|
-}
|
148
|
|
-
|
149
|
|
-
|
150
|
|
-void GLUTSystem::swapBuffersGL()
|
151
|
|
-{
|
152
|
|
- glutSwapBuffers();
|
153
|
|
-}
|
154
|
|
-
|
155
|
|
-
|
156
|
|
-////////////////////////////////////////////////////////////
|
157
|
|
-// Private Accessors
|
158
|
|
-////////////////////////////////////////////////////////////
|
159
|
|
-
|
160
|
|
-
|
161
|
|
-////////////////////////////////////////////////////////////
|
162
|
|
-// Private Mutators
|
163
|
|
-////////////////////////////////////////////////////////////
|
164
|
|
-
|
165
|
|
-
|
166
|
|
-////////////////////////////////////////////////////////////
|
167
|
|
-// Unit Test code
|
168
|
|
-////////////////////////////////////////////////////////////
|
169
|
|
-
|
170
|
|
-#ifdef UNIT_TEST_GLUTSYSTEM
|
171
|
|
-int runGLUTSystemUnitTest(int argc, char *argv[])
|
172
|
|
-{
|
173
|
|
- return 0;
|
174
|
|
-}
|
175
|
|
-
|
176
|
|
-
|
177
|
|
-int main(int argc, char *argv[])
|
178
|
|
-{
|
179
|
|
- GLUTSystem test;
|
180
|
|
-
|
181
|
|
-
|
182
|
|
- printf("[GLUTSystem class test]\n");
|
183
|
|
-
|
184
|
|
- return runGLUTSystemUnitTest(argc, argv);
|
185
|
|
-}
|
186
|
|
-#endif
|