[go: up one dir, main page]

Menu

[878bdd]: / src / gem.h  Maximize  Restore  History

Download this file

290 lines (262 with data), 9.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
/*
*
* Author : Grigore Enescu Madalin
* Author e-mail : gem3dengine@yahoo.com
* Author address : Bd. Dacia, Nr. 6, Et. 7, Ap. 105,
* Piatra Neamt, Judetul Neamt, Romania, 610106
* Contributors : none
*
*
* The contents of this file are subject to The MIT License (the "License").
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://gem3d.sourceforge.net
*
*
* The MIT License
* Copyright (c) 2006 Grigore Enescu Madalin
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE
*
*/
/** \mainpage GEM 3D DOCUMENTATION
*
* <CENTER>Welcome to the first release of the GEM 3D engine.</CENTER>
*
* The GEM 3D is a portable, free, open source, easy to use,
* software development kit which allows you to build high performance 3D graphics
* applications such as games.
*
* <CENTER>For more information, please visit the GEM 3D engine webpage at: http://gem3d.sourceforge.net</CENTER>
*
* \section mainpage_faq FAQ
*
*
* \section mainpage_reporting_bugs Reporting bugs
*
*
* \section mainpage_licence Licence
*
* - \ref page_license
*
* \section mainpage_api GEM API
*
* - \ref page_preprocessor_symbols
*
* - \ref page_base_constants
*
* - \ref page_base_types
*
* - \ref page_base_fmai
*
*/
/** \page page_license GEM 3D License Version 1.00
*
* We have adopted an free and open source license for GEM 3D engine.
* You agreed to the license when you downloaded and installed the software on your machine.
* We strongly encourage you to read the details of the license. A text copy of the license
* can also be found in the main directory in the installation path.
*
* GEM 3D License Version 1.00\n
* Copyright (c) 2004 Grigore Enescu Madalin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* 1. You must display the original, unmodified GEM 3D logo as the first logo on
* startup of your product, demo or application.\n
* 2. You must prominently display the GEM 3D logo on any marketing materials,
* advertising or packaging of your product, demo or application.\n
* 3. You must not remove, alter, obscure, or modify in any way the appearance or
* operation of the GEM 3D logo.\n
* 4. The above copyright notice, this permission notice and the GEM 3D logo must
* be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
* A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* This agreement shall be governed in all respects by the laws of the Romania.
*
*/
/** \page wist What is this ?
*
*/
/** \page wisin What's In The Box ?
*
*/
/** \page install Installation
*
* \section iwindows Installing GEM 3D on Windows
*
* For Windows platform we provide to you a setup application.
* This application should run well on any Windows operating system ( 95, 98, NT, 2000, XP ).
* The application is easy to use. Just follow the instructions from this applicaion and
* you will be ready to use GEM 3D SDK in a minute !
*
* There may be some problems on Windows NT, 2000, XP. You must have administrator privileges
* to install the GEM 3D SDK on your computer. If the setup application fail, please make sure
* you have all the wrights to install new applications on your computer !
*
* If you still can not run the setup application please download the GEM 3D engine for Windows as a ZIP
* archive. Unzip where you want and run the demo application.
*
* \section iother Installing on other platforms
*
* Unfinished.
*/
/** \page features Features
*
*/
/** \page codestyle Code style
*
*
* <B>C++ filename extension is .cpp.</B>
*
* What's the extension of a C++ file ?
* cpp, cc, C, cxx, c++ or maybe C++ ?
* Most compilers could care less, but some are very particular.
* I really don't know what is the best extension.
* For no reason, I've personaly chosen the cpp extension, probably because my first C++
* file was written using this extension.
*
*
* <B>Don't use static constructors.</B>
*
* Static constructors do not work well sometimes.
* A static initialized object is an object which is instanciated at startup time.
*
* For example:
*
* \code
* // This is bad (Non-portable example) ...
* exampleClass staticObject(1);
* \endcode
*
* \code
* // This is good ...
* exampleClass * staticObject;
* // And later create an instance of the class when it is neccesary
* staticObject = new staticObject(1);
* \endcode
*
* <B>Don't use exceptions.</B>
*
* Exceptions are another C++ feature which is not very widely implemented, and as such,
* their use is not portable C++ code. Don't use them.
*
*
* <B>Don't use C++ standard library features, including iostream</B>
*
* Using C++ standard library features involves some portability problems.
* This includes iostream features, such as cin and cout.
*
* <B>Don't use namespace facility.</B>
*
* Support of namespaces (through the namespace and using keywords) is not supported in
* some compilers.
*
*
* <B>Don't put extra top-level semi-colons in code.</B>
*
* This is another problem that seems to show up with some C++ compillers.
* The extra little semi-colon at the end of a function is ignored by most compilers,
* but it is not permitted by the standard and it makes some compilers report errors
* (in particular, gcc 3.4, and also perhaps old versions of the AIX native compiler).
*
* For example:
* \code
* // This is bad (Non-portable example)
* int Example::blabla() {};
*
* // This is good
* int Example::blabla() {}
* \endcode
*
*
* <B>Don't put C++ comments in C code.</B>
*
* Some header files may be included by C files.
* Just stick to C style comments for any header file that is ever likely to be included by a C file.
*
*
* <B>Put a new line at end-of-file.</B>
*
* Not having a new-line char at the end of file breaks h files with the
* Sun WorkShop compiler and it breaks cpp files on HP ( for example ).
* It is better to always have at least a new line at the end of any file ( h or cpp ).
*
*/
#ifndef __GEM_H__
#define __GEM_H__
/* BASE INCLUDES */
#include "g_base.h"
#include "g_assert.h"
#include "g_error.h"
#include "g_string.h"
#include "g_strut.h"
#include "g_array.h"
#include "g_list.h"
#include "g_vector.h"
#include "g_v2.h"
#include "g_v3.h"
#include "g_iv2.h"
#include "g_uv.h"
#include "g_vertex.h"
#include "g_2dline.h"
#include "g_3dline.h"
#include "g_box.h"
#include "g_color.h"
#include "g_cube.h"
#include "g_matrix.h"
#include "g_minmax.h"
#include "g_plane.h"
#include "g_quat.h"
#include "g_rect.h"
#include "g_rrect.h"
#include "g_sphere.h"
#include "g_endian.h"
#include "g_bits.h"
#include "g_crc.h"
#include "g_compr.h"
#include "g_info.h"
#include "g_time.h"
#include "g_conver.h"
/* OS */
#include "g_os.h"
#include "g_oscpu.h"
#include "g_osdll.h"
#include "g_osmb.h"
#include "g_osmem.h"
#include "g_ospt.h"
#include "g_ostime.h"
/* DEVICES */
#include "g_devopt.h"
#include "g_dev.h"
/** Create and return a new instance of the gemDevice.
*/
GEM_ERRI * gemCreateDevice( const gemDeviceOptions & pDeviceOptions, gemDevice ** pDevice );
#endif