orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
orxType.h
Go to the documentation of this file.
1/* Orx - Portable Game Engine
2 *
3 * Copyright (c) 2008- Orx-Project
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 *
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 *
21 * 3. This notice may not be removed or altered from any source
22 * distribution.
23 */
24
32
40
41
42#ifndef _orxTYPE_H_
43#define _orxTYPE_H_
44
45/* *** Uses orx declarations *** */
46#include "base/orxDecl.h"
47
48/* *** Platform dependent base types */
49
50/* Windows */
51#ifdef __orxWINDOWS__
52
53 #ifdef __orxX86_64__
54
55 typedef unsigned int orxU32;
56 typedef unsigned short orxU16;
57 typedef unsigned char orxU8;
58
59 typedef signed int orxS32;
60 typedef signed short orxS16;
61 typedef signed char orxS8;
62
63 typedef unsigned int orxBOOL;
64
65 #else /* __orxX86_64__ */
66
67 typedef unsigned long orxU32;
68 typedef unsigned short orxU16;
69 typedef unsigned char orxU8;
70
71 typedef signed long orxS32;
72 typedef signed short orxS16;
73 typedef signed char orxS8;
74
75 typedef unsigned long orxBOOL;
76
77 #endif /* __orxX86_64__ */
78
79 /* Compiler specific */
80 #ifdef __orxGCC__
81
82 typedef unsigned long long orxU64;
83 typedef signed long long orxS64;
84
85 #endif /* __orxGCC__ */
86 #ifdef __orxLLVM__
87
88 typedef unsigned long long orxU64;
89 typedef signed long long orxS64;
90
91 #endif /* __orxLLVM__ */
92 #ifdef __orxMSVC__
93
94 typedef unsigned __int64 orxU64;
95 typedef signed __int64 orxS64;
96
97 #endif /* __orxMSVC__ */
98
99 typedef float orxFLOAT;
100 typedef double orxDOUBLE;
101
102 typedef char orxCHAR;
103 #define orxSTRING orxCHAR *
104 typedef orxU64 orxSTRINGID;
105
106 typedef orxU32 orxENUM;
107
108 #define orx2F(V) ((orxFLOAT)(V))
109 #define orx2D(V) ((orxDOUBLE)(V))
110
111 #define orxENUM_NONE 0xFFFFFFFF
112
113#else /* __orxWINDOWS__ */
114
115 /* Linux / Mac / iOS / Android / Web */
116 #if defined(__orxLINUX__) || defined(__orxMAC__) || defined(__orxIOS__) || defined(__orxANDROID__) || defined(__orxWEB__)
117
118 #ifdef __orx64__
119
120 typedef unsigned long long orxU64;
121 typedef unsigned int orxU32;
122 typedef unsigned short orxU16;
123 typedef unsigned char orxU8;
124
125 typedef signed long long orxS64;
126 typedef signed int orxS32;
127 typedef signed short orxS16;
128 typedef signed char orxS8;
129
130 typedef unsigned int orxBOOL;
131
132 #else /* __orx64__ */
133
134 typedef unsigned long long orxU64;
135 typedef unsigned long orxU32;
136 typedef unsigned short orxU16;
137 typedef unsigned char orxU8;
138
139 typedef signed long long orxS64;
140 typedef signed long orxS32;
141 typedef signed short orxS16;
142 typedef signed char orxS8;
143
144 typedef unsigned long orxBOOL;
145
146 #endif /* __orx64__ */
147
148 typedef float orxFLOAT;
149 typedef double orxDOUBLE;
150
151 typedef char orxCHAR;
152 #define orxSTRING orxCHAR *
153 typedef orxU64 orxSTRINGID;
154
155 typedef orxU32 orxENUM;
156
157 #define orx2F(V) ((orxFLOAT)(V))
158 #define orx2D(V) ((orxDOUBLE)(V))
159
160 #define orxENUM_NONE 0xFFFFFFFF
161
162 #endif /* __orxLINUX__ || __orxMAC__ || __orxIOS__ || __orxANDROID__ || __orxWEB__ */
163
164#endif /* __orxWINDOWS__ */
165
166typedef void * orxHANDLE;
167
168#if defined(__orx64__)
169
170 typedef orxS64 orxSPTR;
171 typedef orxU64 orxUPTR;
172
173#elif defined(__orx32__)
174
175 typedef orxS32 orxSPTR;
176 typedef orxU32 orxUPTR;
177
178#endif
179
180/* *** Misc constants *** */
181
182/* *** Seek offset constants *** */
194
207
208
209/* *** Boolean constants *** */
210#define orxFALSE ((orxBOOL)(1 != 1))
211#define orxTRUE ((orxBOOL)(1 == 1))
212
213
214/* *** Float constants *** */
215static const orxFLOAT orxFLOAT_0 = orx2F(0.0f);
216static const orxFLOAT orxFLOAT_1 = orx2F(1.0f);
217static const orxFLOAT orxFLOAT_MAX = orx2F(3.402823466e+38f);
218
219/* *** Double constants *** */
220static const orxDOUBLE orxDOUBLE_0 = orx2D(0.0);
221static const orxDOUBLE orxDOUBLE_1 = orx2D(1.0);
222static const orxDOUBLE orxDOUBLE_MAX = orx2D(1.7976931348623158e+308);
223
224
225/* *** Undefined constants *** */
226static const orxU64 orxU64_UNDEFINED = (orxU64)(-1);
227static const orxU32 orxU32_UNDEFINED = (orxU32)(-1);
228static const orxU16 orxU16_UNDEFINED = (orxU16)(-1);
229static const orxU8 orxU8_UNDEFINED = (orxU8)(-1);
231static const orxSTRINGID orxSTRINGID_UNDEFINED = (orxSTRINGID)(-1);
232
233
234/* *** String & character constants *** */
235extern orxDLLAPI const orxSTRING orxSTRING_EMPTY;
236extern orxDLLAPI const orxSTRING orxSTRING_TRUE;
237extern orxDLLAPI const orxSTRING orxSTRING_FALSE;
238extern orxDLLAPI const orxSTRING orxSTRING_EOL;
239
240#define orxCHAR_NULL '\0'
241#define orxCHAR_CR '\r'
242#define orxCHAR_LF '\n'
243#define orxCHAR_EOL '\n'
244#define orxCHAR_ASCII_NUMBER 128
245
246#define _orxSTRINGIFY(X) #X
247#define orxSTRINGIFY(X) _orxSTRINGIFY(X)
248
249
250/* *** Directory separators *** */
251
252extern orxDLLAPI const orxSTRING orxSTRING_DIRECTORY_SEPARATOR;
253
254#define orxCHAR_DIRECTORY_SEPARATOR_WINDOWS '\\'
255#define orxCHAR_DIRECTORY_SEPARATOR_LINUX '/'
256
257#ifdef __orxWINDOWS__
258
259#define orxCHAR_DIRECTORY_SEPARATOR '\\'
260
261#else /* __orxWINDOWS__ */
262
263#define orxCHAR_DIRECTORY_SEPARATOR '/'
264
265#endif /* __orxWINDOWS__ */
266
267
268/* *** Status defines *** */
269typedef enum __orxSTATUS_t
270{
273
275
276 orxSTATUS_NONE = orxENUM_NONE
277
278} orxSTATUS;
279
280#endif /*_orxTYPE_H_*/
281
#define orxDLLAPI
Definition orxDecl.h:381
orxSEEK_OFFSET_WHENCE
Definition orxType.h:184
void * orxHANDLE
Definition orxType.h:166
orxSTATUS
Definition orxType.h:270
orxDLLAPI const orxSTRING orxSTRING_TRUE
static const orxFLOAT orxFLOAT_MAX
Definition orxType.h:217
static const orxSTRINGID orxSTRINGID_UNDEFINED
Definition orxType.h:231
static const orxU16 orxU16_UNDEFINED
Definition orxType.h:228
orxDLLAPI const orxSTRING orxSTRING_EOL
orxDLLAPI const orxSTRING orxSTRING_FALSE
static const orxDOUBLE orxDOUBLE_MAX
Definition orxType.h:222
static const orxDOUBLE orxDOUBLE_0
Definition orxType.h:220
static const orxU64 orxU64_UNDEFINED
Definition orxType.h:226
static const orxFLOAT orxFLOAT_1
Definition orxType.h:216
orxCOLORSPACE
Definition orxType.h:196
static const orxDOUBLE orxDOUBLE_1
Definition orxType.h:221
orxDLLAPI const orxSTRING orxSTRING_DIRECTORY_SEPARATOR
static const orxFLOAT orxFLOAT_0
Definition orxType.h:215
orxDLLAPI const orxSTRING orxSTRING_EMPTY
static const orxHANDLE orxHANDLE_UNDEFINED
Definition orxType.h:230
static const orxU8 orxU8_UNDEFINED
Definition orxType.h:229
static const orxU32 orxU32_UNDEFINED
Definition orxType.h:227
@ orxSEEK_OFFSET_WHENCE_CURRENT
Definition orxType.h:186
@ orxSEEK_OFFSET_WHENCE_NUMBER
Definition orxType.h:189
@ orxSEEK_OFFSET_WHENCE_NONE
Definition orxType.h:191
@ orxSEEK_OFFSET_WHENCE_START
Definition orxType.h:185
@ orxSEEK_OFFSET_WHENCE_END
Definition orxType.h:187
@ orxSTATUS_NUMBER
Definition orxType.h:274
@ orxSTATUS_SUCCESS
Definition orxType.h:272
@ orxSTATUS_NONE
Definition orxType.h:276
@ orxSTATUS_FAILURE
Definition orxType.h:271
@ orxCOLORSPACE_NUMBER
Definition orxType.h:202
@ orxCOLORSPACE_NONE
Definition orxType.h:204
@ orxCOLORSPACE_RGB
Definition orxType.h:200
@ orxCOLORSPACE_COMPONENT
Definition orxType.h:197
@ orxCOLORSPACE_HSL
Definition orxType.h:198
@ orxCOLORSPACE_HSV
Definition orxType.h:199

Generated for orx by doxygen 1.8.11