Imported more code from the old engine.
[peakengine.git] / engine / include / support / IrrCompileConfig.h
blobd752acc4153109b21427a5153cb22e3248bf8381
1 // Copyright (C) 2002-2007 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
5 #ifndef __IRR_COMPILE_CONFIG_H_INCLUDED__
6 #define __IRR_COMPILE_CONFIG_H_INCLUDED__
8 //! Irrlicht SDK Version
9 #define IRRLICHT_SDK_VERSION "1.4"
11 //! The defines for different operating system are:
12 //! _IRR_XBOX_PLATFORM_ for XBox
13 //! _IRR_WINDOWS_ for all irrlicht supported Windows versions
14 //! _IRR_WINDOWS_API_ for Windows or XBox
15 //! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined)
16 //! _IRR_SOLARIS_PLATFORM_ for Solaris
17 //! _IRR_POSIX_API_ for Posix compatible systems
18 //! _IRR_USE_SDL_DEVICE_ for platform independent SDL framework
19 //! _IRR_USE_WINDOWS_DEVICE_ for Windows API based device
20 //! _IRR_USE_LINUX_DEVICE_ for X11 based device
21 //! MACOSX for Mac OS X
23 //#define _IRR_USE_SDL_DEVICE_ 1
25 //! WIN32 for Windows32
26 //! WIN64 for Windows64
27 #if defined(WIN32) || defined(WIN64)
28 #define _IRR_WINDOWS_
29 #define _IRR_WINDOWS_API_
30 #ifndef _IRR_USE_SDL_DEVICE_
31 #define _IRR_USE_WINDOWS_DEVICE_
32 #endif
33 #endif
35 #if defined(_XBOX)
36 #define _IRR_XBOX_PLATFORM_
37 #define _IRR_WINDOWS_API_
38 #endif
40 #if !defined(_IRR_WINDOWS_API_) && !defined(MACOSX)
41 #if defined(__sparc__) || defined(__sun__)
42 #define __BIG_ENDIAN__
43 #define _IRR_SOLARIS_PLATFORM_
44 #else
45 #define _IRR_LINUX_PLATFORM_
46 #endif
47 #define _IRR_POSIX_API_
49 #ifndef _IRR_USE_SDL_DEVICE_
50 #define _IRR_USE_LINUX_DEVICE_
51 #endif
52 #endif
54 #include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw
56 //! Define _IRR_COMPILE_WITH_DIRECT3D_8_ and _IRR_COMPILE_WITH_DIRECT3D_9_ to
57 //! compile the Irrlicht engine with Direct3D8 and/or DIRECT3D9.
58 /** If you only want to use the software device or opengl this can be useful.
59 This switch is mostly disabled because people do not get the g++ compiler compile
60 directX header files, and directX is only available on windows platforms. If you
61 are using Dev-Cpp, and want to compile this using a DX dev pack, you can define
62 _IRR_COMPILE_WITH_DX9_DEV_PACK_. So you simply need to add something like this
63 to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK
64 and this to the linker settings: -ld3dx9 -ld3dx8 **/
65 #if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK))
67 #define _IRR_COMPILE_WITH_DIRECT3D_8_
68 #define _IRR_COMPILE_WITH_DIRECT3D_9_
70 #endif
72 //! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL.
73 /** If you do not wish the engine to be compiled with OpengGL, comment this
74 define out. */
75 #define _IRR_COMPILE_WITH_OPENGL_
77 //! Define _IRR_COMPILE_WITH_SOFTWARE_ to compile the Irrlicht engine with software driver
78 /** If you do not need the software driver, or want to use Burning's Video instead,
79 comment this define out */
80 #define _IRR_COMPILE_WITH_SOFTWARE_
82 //! Define _IRR_COMPILE_WITH_BURNINGSVIDEO_ to compile the Irrlicht engine with Burning's video driver
83 /** If you do not need this software driver, you can comment this define out. */
84 #define _IRR_COMPILE_WITH_BURNINGSVIDEO_
86 //! Define _IRR_COMPILE_WITH_X11_ to compile the Irrlicht engine with X11 support.
87 /** If you do not wish the engine to be compiled with X11, comment this
88 define out. */
89 // Only used in LinuxDevice.
90 #define _IRR_COMPILE_WITH_X11_
92 //! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers.
93 /** On some systems there is no support for the dynamic extension of OpenGL
94 via function pointers such that this has to be undef'ed. */
95 #if !defined(MACOSX) && !defined(_IRR_SOLARIS_PLATFORM_)
96 #define _IRR_OPENGL_USE_EXTPOINTER_
97 #endif
99 //! On some Linux systems the XF86 vidmode extension or X11 RandR are missing. Use these flags
100 //! to remove the dependencies such that Irrlicht will compile on those systems, too.
101 #if defined(_IRR_LINUX_PLATFORM_)
102 #define _IRR_LINUX_X11_VIDMODE_
103 //#define _IRR_LINUX_X11_RANDR_
104 #endif
106 //! Define _IRR_COMPILE_WITH_GUI_ to compile the engine with the built-in GUI
107 /** Disable this if you are using an external library to draw the GUI. If you disable this then
108 you will not be able to use anything provided by the GUI Environment, including loading fonts. */
109 #define _IRR_COMPILE_WITH_GUI_
111 //! Define _IRR_COMPILE_WITH_ZLIB_ to enable compiling the engine using zlib.
112 /** This enables the engine to read from compressed .zip archives. If you
113 disable this feature, the engine can still read archives, but only uncompressed
114 ones. */
115 #define _IRR_COMPILE_WITH_ZLIB_
117 //! Define _IRR_USE_NON_SYSTEM_ZLIB_ to let irrlicht use the zlib which comes with irrlicht.
118 /** If this is commented out, Irrlicht will try to compile using the zlib installed in the system.
119 This is only used when _IRR_COMPILE_WITH_ZLIB_ is defined. */
120 #define _IRR_USE_NON_SYSTEM_ZLIB_
123 //! Define _IRR_COMPILE_WITH_JPEGLIB_ to enable compiling the engine using libjpeg.
124 /** This enables the engine to read jpeg images. If you comment this out,
125 the engine will no longer read .jpeg images. */
126 #define _IRR_COMPILE_WITH_LIBJPEG_
128 //! Define _IRR_USE_NON_SYSTEM_JPEG_LIB_ to let irrlicht use the jpeglib which comes with irrlicht.
129 /** If this is commented out, Irrlicht will try to compile using the jpeg lib installed in the system.
130 This is only used when _IRR_COMPILE_WITH_LIBJPEG_ is defined. */
131 #define _IRR_USE_NON_SYSTEM_JPEG_LIB_
134 //! Define _IRR_COMPILE_WITH_LIBPNG_ to enable compiling the engine using libpng.
135 /** This enables the engine to read png images. If you comment this out,
136 the engine will no longer read .png images. */
137 #define _IRR_COMPILE_WITH_LIBPNG_
139 //! Define _IRR_USE_NON_SYSTEM_LIBPNG_ to let irrlicht use the libpng which comes with irrlicht.
140 /** If this is commented out, Irrlicht will try to compile using the libpng installed in the system.
141 This is only used when _IRR_COMPILE_WITH_LIBPNG_ is defined. */
142 #define _IRR_USE_NON_SYSTEM_LIB_PNG_
145 //! Define _IRR_D3D_NO_SHADER_DEBUGGING to disable shader debugging in D3D9
146 /** If _IRR_D3D_NO_SHADER_DEBUGGING is undefined in IrrCompileConfig.h,
147 it is possible to debug all D3D9 shaders in VisualStudio. All shaders
148 (which have been generated in memory or read from archives for example) will be emitted
149 into a temporary file at runtime for this purpose. To debug your shaders, choose
150 Debug->Direct3D->StartWithDirect3DDebugging in Visual Studio, and for every shader a
151 file named 'irr_dbg_shader_%%.vsh' or 'irr_dbg_shader_%%.psh' will be created. Drag'n'drop
152 the file you want to debug into visual studio. That's it. You can now set breakpoints and
153 watch registers, variables etc. This works with ASM, HLSL, and both with pixel and vertex shaders.
154 Note that the engine will run in D3D REF for this, which is a lot slower than HAL. */
155 #define _IRR_D3D_NO_SHADER_DEBUGGING
158 #ifdef _IRR_WINDOWS_API_
160 #ifndef _IRR_STATIC_LIB_
161 #ifdef IRRLICHT_EXPORTS
162 #define IRRLICHT_API __declspec(dllexport)
163 #else
164 #define IRRLICHT_API __declspec(dllimport)
165 #endif // IRRLICHT_EXPORT
166 #else
167 #define IRRLICHT_API
168 #endif // _IRR_STATIC_LIB_
170 // Declare the calling convention.
171 #if defined(_STDCALL_SUPPORTED)
172 #define IRRCALLCONV __stdcall
173 #else
174 #define IRRCALLCONV __cdecl
175 #endif // STDCALL_SUPPORTED
177 #else
178 #define IRRLICHT_API
179 #define IRRCALLCONV
180 #endif // _IRR_WINDOWS_API_
182 // We need to disable DIRECT3D9 support for Visual Studio 6.0 because
183 // those $%&$!! disabled support for it since Dec. 2004 and users are complaining
184 // about linker errors. Comment this out only if you are knowing what you are
185 // doing. (Which means you have an old DX9 SDK and VisualStudio6).
186 #ifdef _MSC_VER
187 #if (_MSC_VER < 1300 && !defined(__GNUC__))
188 #undef _IRR_COMPILE_WITH_DIRECT3D_9_
189 #pragma message("Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.")
190 #endif
191 #endif
193 //! Define one of the three setting for Burning's Video Software Rasterizer
194 /** So if we were marketing guys we could says Irrlicht has 4 Software-Rasterizers.
195 In a Nutshell:
196 All Burnings Rasterizers use 32 Bit Backbuffer, 32Bit Texture & 32 Bit Z or WBuffer,
197 16 Bit/32 Bit can be adjusted on a global flag.
199 BURNINGVIDEO_RENDERER_BEAUTIFUL
200 32 Bit + Vertexcolor + Lighting + Per Pixel Perspective Correct + SubPixel/SubTexel Correct +
201 Bilinear Texturefiltering + WBuffer
203 BURNINGVIDEO_RENDERER_FAST
204 32 Bit + Per Pixel Perspective Correct + SubPixel/SubTexel Correct + WBuffer +
205 Bilinear Dithering TextureFiltering + WBuffer
207 BURNINGVIDEO_RENDERER_ULTRA_FAST
208 16Bit + SubPixel/SubTexel Correct + ZBuffer
211 #define BURNINGVIDEO_RENDERER_BEAUTIFUL
212 //#define BURNINGVIDEO_RENDERER_FAST
213 //#define BURNINGVIDEO_RENDERER_ULTRA_FAST
216 //! Define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ if you want to use bone based
217 /** animated meshes. If you compile without this, you will be unable to load
218 B3D, MS3D or X meshes */
219 #define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
221 #ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
222 //! Define _IRR_COMPILE_WITH_B3D_LOADER_ if you want to use Blitz3D files
223 #define _IRR_COMPILE_WITH_B3D_LOADER_
224 //! Define _IRR_COMPILE_WITH_B3D_LOADER_ if you want to Milkshape files
225 #define _IRR_COMPILE_WITH_MS3D_LOADER_
226 //! Define _IRR_COMPILE_WITH_X_LOADER_ if you want to use Microsoft X files
227 #define _IRR_COMPILE_WITH_X_LOADER_
228 #endif
230 //! Define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ if you want to load Irrlicht Engine .irrmesh files
231 #define _IRR_COMPILE_WITH_IRR_MESH_LOADER_
233 //! Define _IRR_COMPILE_WITH_MD2_LOADER_ if you want to load Quake 2 animated files
234 #define _IRR_COMPILE_WITH_MD2_LOADER_
235 //! Define _IRR_COMPILE_WITH_MD3_LOADER_ if you want to load Quake 3 animated files
236 #define _IRR_COMPILE_WITH_MD3_LOADER_
238 //! Define _IRR_COMPILE_WITH_3DS_LOADER_ if you want to load 3D Studio Max files
239 #define _IRR_COMPILE_WITH_3DS_LOADER_
240 //! Define _IRR_COMPILE_WITH_COLLADA_LOADER_ if you want to load Collada files
241 #define _IRR_COMPILE_WITH_COLLADA_LOADER_
242 //! Define _IRR_COMPILE_WITH_CSM_LOADER_ if you want to load Cartography Shop files
243 #define _IRR_COMPILE_WITH_CSM_LOADER_
244 //! Define _IRR_COMPILE_WITH_BSP_LOADER_ if you want to load Quake 3 BSP files
245 #define _IRR_COMPILE_WITH_BSP_LOADER_
246 //! Define _IRR_COMPILE_WITH_DMF_LOADER_ if you want to load DeleD files
247 #define _IRR_COMPILE_WITH_DMF_LOADER_
248 //! Define _IRR_COMPILE_WITH_LMTS_LOADER_ if you want to load LMTools files
249 #define _IRR_COMPILE_WITH_LMTS_LOADER_
250 //! Define _IRR_COMPILE_WITH_MY3D_LOADER_ if you want to load MY3D files
251 #define _IRR_COMPILE_WITH_MY3D_LOADER_
252 //! Define _IRR_COMPILE_WITH_OBJ_LOADER_ if you want to load Wavefront OBJ files
253 #define _IRR_COMPILE_WITH_OBJ_LOADER_
254 //! Define _IRR_COMPILE_WITH_OCT_LOADER_ if you want to load FSRad OCT files
255 #define _IRR_COMPILE_WITH_OCT_LOADER_
256 //! Define _IRR_COMPILE_WITH_OGRE_LOADER_ if you want to load Ogre 3D files
257 #define _IRR_COMPILE_WITH_OGRE_LOADER_
258 //! Define _IRR_COMPILE_WITH_STL_LOADER_ if you want to load .stl files
259 #define _IRR_COMPILE_WITH_STL_LOADER_
261 //! Define _IRR_COMPILE_WITH_IRR_WRITER_ if you want to write static .irr files
262 #define _IRR_COMPILE_WITH_IRR_WRITER_
263 //! Define _IRR_COMPILE_WITH_COLLADA_WRITER_ if you want to write Collada files
264 #define _IRR_COMPILE_WITH_COLLADA_WRITER_
265 //! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files
266 #define _IRR_COMPILE_WITH_STL_WRITER_
268 //! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files
269 #define _IRR_COMPILE_WITH_BMP_LOADER_
270 //! Define _IRR_COMPILE_WITH_JPG_LOADER_ if you want to load .jpg files
271 #define _IRR_COMPILE_WITH_JPG_LOADER_
272 //! Define _IRR_COMPILE_WITH_PCX_LOADER_ if you want to load .pcx files
273 #define _IRR_COMPILE_WITH_PCX_LOADER_
274 //! Define _IRR_COMPILE_WITH_PNG_LOADER_ if you want to load .png files
275 #define _IRR_COMPILE_WITH_PNG_LOADER_
276 //! Define _IRR_COMPILE_WITH_PPM_LOADER_ if you want to load .ppm/.pgm/.pbm files
277 #define _IRR_COMPILE_WITH_PPM_LOADER_
278 //! Define _IRR_COMPILE_WITH_PSD_LOADER_ if you want to load .psd files
279 #define _IRR_COMPILE_WITH_PSD_LOADER_
280 //! Define _IRR_COMPILE_WITH_TGA_LOADER_ if you want to load .tga files
281 #define _IRR_COMPILE_WITH_TGA_LOADER_
283 //! Define _IRR_COMPILE_WITH_BMP_WRITER_ if you want to write .bmp files
284 #define _IRR_COMPILE_WITH_BMP_WRITER_
285 //! Define _IRR_COMPILE_WITH_JPG_WRITER_ if you want to write .jpg files
286 #define _IRR_COMPILE_WITH_JPG_WRITER_
287 //! Define _IRR_COMPILE_WITH_PCX_WRITER_ if you want to write .pcx files
288 #define _IRR_COMPILE_WITH_PCX_WRITER_
289 //! Define _IRR_COMPILE_WITH_PNG_WRITER_ if you want to write .png files
290 #define _IRR_COMPILE_WITH_PNG_WRITER_
291 //! Define _IRR_COMPILE_WITH_PPM_WRITER_ if you want to write .ppm files
292 #define _IRR_COMPILE_WITH_PPM_WRITER_
293 //! Define _IRR_COMPILE_WITH_PSD_WRITER_ if you want to write .psd files
294 #define _IRR_COMPILE_WITH_PSD_WRITER_
295 //! Define _IRR_COMPILE_WITH_TGA_WRITER_ if you want to write .tga files
296 #define _IRR_COMPILE_WITH_TGA_WRITER_
298 //! Set FPU settings
299 /** Irrlicht should use approximate float and integer fpu techniques
300 precision will be lower but speed higher. currently X86 only
302 #if !defined(MACOSX) && !defined(_IRR_SOLARIS_PLATFORM_)
303 //#define IRRLICHT_FAST_MATH
304 #endif
306 // Some cleanup
307 // XBox does not have OpenGL or DirectX9
308 #if defined(_IRR_XBOX_PLATFORM_)
309 #undef _IRR_COMPILE_WITH_OPENGL_
310 #undef _IRR_COMPILE_WITH_DIRECT3D_9_
311 #endif
313 #endif // __IRR_COMPILE_CONFIG_H_INCLUDED__