1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __IRR_COMPILE_CONFIG_H_INCLUDED__
\r
6 #define __IRR_COMPILE_CONFIG_H_INCLUDED__
\r
8 //! Identifies the IrrlichtMt fork customized for the Minetest engine
\r
9 #define IRRLICHT_VERSION_MT_REVISION 9
\r
10 #define IRRLICHT_VERSION_MT "mt9"
\r
12 //! Irrlicht SDK Version
\r
13 #define IRRLICHT_VERSION_MAJOR 1
\r
14 #define IRRLICHT_VERSION_MINOR 9
\r
15 #define IRRLICHT_VERSION_REVISION 0
\r
16 // This flag will be defined only in SVN, the official release code will have
\r
18 #define IRRLICHT_VERSION_SVN alpha
\r
19 #define IRRLICHT_SDK_VERSION "1.9.0" IRRLICHT_VERSION_MT
\r
21 #include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw
\r
23 //! The defines for different operating system are:
\r
24 //! _IRR_WINDOWS_ for all irrlicht supported Windows versions
\r
25 //! _IRR_WINDOWS_API_ for Windows or XBox
\r
26 //! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined)
\r
27 //! _IRR_SOLARIS_PLATFORM_ for Solaris
\r
28 //! _IRR_OSX_PLATFORM_ for Apple systems running OSX
\r
29 //! _IRR_IOS_PLATFORM_ for Apple devices running iOS
\r
30 //! _IRR_ANDROID_PLATFORM_ for devices running Android
\r
31 //! _IRR_POSIX_API_ for Posix compatible systems
\r
32 //! Note: PLATFORM defines the OS specific layer, API can group several platforms
\r
34 //! DEVICE is the windowing system used, several PLATFORMs support more than one DEVICE
\r
35 //! Irrlicht can be compiled with more than one device
\r
36 //! _IRR_COMPILE_WITH_WINDOWS_DEVICE_ for Windows API based device
\r
37 //! _IRR_COMPILE_WITH_OSX_DEVICE_ for Cocoa native windowing on OSX
\r
38 //! _IRR_COMPILE_WITH_X11_DEVICE_ for Linux X11 based device
\r
39 //! _IRR_COMPILE_WITH_SDL_DEVICE_ for platform independent SDL framework
\r
41 //! Passing defines to the compiler which have NO in front of the _IRR definename is an alternative
\r
42 //! way which can be used to disable defines (instead of outcommenting them in this header).
\r
43 //! So defines can be controlled from Makefiles or Projectfiles which allows building
\r
44 //! different library versions without having to change the sources.
\r
45 //! Example: NO_IRR_COMPILE_WITH_X11_ would disable X11
\r
47 //! Uncomment this line to compile with the SDL device
\r
48 //#define _IRR_COMPILE_WITH_SDL_DEVICE_
\r
49 #ifdef NO_IRR_COMPILE_WITH_SDL_DEVICE_
\r
50 #undef _IRR_COMPILE_WITH_SDL_DEVICE_
\r
53 //! WIN32 for Windows32
\r
54 //! WIN64 for Windows64
\r
55 // The windows platform and API support SDL and WINDOW device
\r
56 #if defined(_WIN32) || defined(_WIN64)
\r
57 #define _IRR_WINDOWS_
\r
58 #define _IRR_WINDOWS_API_
\r
59 #ifndef _IRR_COMPILE_WITH_SDL_DEVICE_
\r
60 #define _IRR_COMPILE_WITH_WINDOWS_DEVICE_
\r
64 #if defined(__APPLE__)
\r
65 #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
\r
66 #define _IRR_IOS_PLATFORM_
\r
67 #define _IRR_COMPILE_WITH_IOS_DEVICE_
\r
68 #define NO_IRR_COMPILE_WITH_OPENGL_
\r
69 // The application state events and following methods: IrrlichtDevice::isWindowActive, IrrlichtDevice::isWindowFocused,
\r
70 // IrrlichtDevice::isWindowMinimized works out of box only if you'll use built-in CIrrDelegateiOS,
\r
71 // so _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_ must be enabled in this case. If you need a custom UIApplicationDelegate
\r
72 // you must disable _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_ definition and handle all application events yourself.
\r
73 #define _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_
\r
75 #define _IRR_OSX_PLATFORM_
\r
76 #ifndef _IRR_COMPILE_WITH_SDL_DEVICE_
\r
77 #define _IRR_COMPILE_WITH_OSX_DEVICE_
\r
79 #define NO_IRR_COMPILE_WITH_OGLES1_
\r
80 #define NO_IRR_COMPILE_WITH_OGLES2_
\r
81 #define NO_IRR_COMPILE_WITH_WEBGL1_
\r
85 #if defined(__EMSCRIPTEN__)
\r
86 #define _IRR_EMSCRIPTEN_PLATFORM_
\r
87 #define NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_
\r
88 #define NO_IRR_COMPILE_WITH_OPENGL_
\r
89 #define NO_IRR_COMPILE_WITH_OGLES1_
\r
90 #define _IRR_COMPILE_WITH_OGLES2_
\r
91 #define _IRR_COMPILE_WITH_WEBGL1_
\r
92 #define _IRR_COMPILE_WITH_EGL_MANAGER_
\r
93 #define _IRR_COMPILE_WITH_SDL_DEVICE_
\r
94 #define NO_IRR_COMPILE_WITH_X11_DEVICE_
\r
95 #define _IRR_LINUX_PLATFORM_ // emscripten basically working like a unix
\r
96 #endif // __EMSCRIPTEN__
\r
98 #if defined(__ANDROID__)
\r
99 #define _IRR_ANDROID_PLATFORM_
\r
100 #define _IRR_COMPILE_WITH_ANDROID_DEVICE_
\r
101 #define _IRR_COMPILE_ANDROID_ASSET_READER_
\r
102 #define NO_IRR_COMPILE_WITH_OPENGL_
\r
105 #if defined(__SVR4) && defined(__sun)
\r
106 #define _IRR_SOLARIS_PLATFORM_
\r
107 #if defined(__sparc)
\r
108 #define __BIG_ENDIAN__
\r
112 #if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_IOS_PLATFORM_) && !defined(_IRR_ANDROID_PLATFORM_) && !defined(_IRR_EMSCRIPTEN_PLATFORM_)
\r
113 #ifndef _IRR_SOLARIS_PLATFORM_
\r
114 #define _IRR_LINUX_PLATFORM_
\r
116 #define _IRR_POSIX_API_
\r
117 #ifndef _IRR_COMPILE_WITH_SDL_DEVICE_
\r
118 #define _IRR_COMPILE_WITH_X11_DEVICE_
\r
123 //! Define _IRR_COMPILE_WITH_JOYSTICK_SUPPORT_ if you want joystick events.
\r
124 #if !(defined(__FreeBSD__) || defined(__OpenBSD__))
\r
125 #define _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
\r
127 #ifdef NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_
\r
128 #undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
\r
132 //! Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht.
\r
133 #define _IRR_MATERIAL_MAX_TEXTURES_ 4
\r
135 //! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL.
\r
136 /** If you do not wish the engine to be compiled with OpenGL, comment this
\r
138 #define _IRR_COMPILE_WITH_OPENGL_
\r
139 #ifdef NO_IRR_COMPILE_WITH_OPENGL_
\r
140 #undef _IRR_COMPILE_WITH_OPENGL_
\r
143 //! Define required options for OpenGL drivers.
\r
144 #if defined(_IRR_COMPILE_WITH_OPENGL_)
\r
145 #if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
\r
146 #define _IRR_OPENGL_USE_EXTPOINTER_
\r
147 #define _IRR_COMPILE_WITH_WGL_MANAGER_
\r
148 #elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
\r
149 #define _IRR_OPENGL_USE_EXTPOINTER_
\r
150 #define _IRR_COMPILE_WITH_GLX_MANAGER_
\r
151 #elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
\r
152 #define _IRR_COMPILE_WITH_NSOGL_MANAGER_
\r
153 #elif defined(_IRR_SOLARIS_PLATFORM_)
\r
154 #define _IRR_COMPILE_WITH_GLX_MANAGER_
\r
155 #elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
\r
156 #define _IRR_OPENGL_USE_EXTPOINTER_
\r
160 //! Define _IRR_COMPILE_WITH_OGLES1_ to compile the Irrlicht engine with OpenGL ES 1.1.
\r
161 /** If you do not wish the engine to be compiled with OpenGL ES 1.1, comment this
\r
163 Depending on platform you may have to enable _IRR_OGLES1_USE_KHRONOS_API_HEADERS_ as well when using it.
\r
165 #if defined(_IRR_ANDROID_PLATFORM_) || defined(_IRR_IOS_PLATFORM_)
\r
166 #define _IRR_COMPILE_WITH_OGLES1_
\r
168 #ifdef NO_IRR_COMPILE_WITH_OGLES1_
\r
169 #undef _IRR_COMPILE_WITH_OGLES1_
\r
172 #ifdef _IRR_COMPILE_WITH_OGLES1_
\r
173 //! Define _IRR_OGLES1_USE_KHRONOS_API_HEADERS_ to use the OpenGL ES headers from the Debian Khronos-api package
\r
174 //#define _IRR_OGLES1_USE_KHRONOS_API_HEADERS_
\r
177 //! Define required options for OpenGL ES 1.1 drivers.
\r
178 #if defined(_IRR_COMPILE_WITH_OGLES1_)
\r
179 #if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
\r
180 #define _IRR_OGLES1_USE_EXTPOINTER_
\r
181 #ifndef _IRR_COMPILE_WITH_EGL_MANAGER_
\r
182 #define _IRR_COMPILE_WITH_EGL_MANAGER_
\r
184 #elif defined(_IRR_COMPILE_WITH_IOS_DEVICE_)
\r
185 #ifndef _IRR_COMPILE_WITH_EAGL_MANAGER_
\r
186 #define _IRR_COMPILE_WITH_EAGL_MANAGER_
\r
191 //! Define _IRR_COMPILE_WITH_OGLES2_ to compile the Irrlicht engine with OpenGL ES 2.0.
\r
192 /** If you do not wish the engine to be compiled with OpenGL ES 2.0, comment this
\r
194 #if defined(_IRR_ANDROID_PLATFORM_) || defined(_IRR_IOS_PLATFORM_)
\r
195 #define _IRR_COMPILE_WITH_OGLES2_
\r
197 //#define _IRR_COMPILE_WITH_OGLES2_
\r
199 #ifdef NO_IRR_COMPILE_WITH_OGLES2_
\r
200 #undef _IRR_COMPILE_WITH_OGLES2_
\r
203 //! Define _IRR_COMPILE_WITH_WEBGL1_ to compile Irrlicht engine with a WebGL friendly
\r
204 //! subset of the OpenGL ES 2.0 driver.
\r
205 //#define _IRR_COMPILE_WITH_WEBGL1_
\r
206 #ifdef NO_IRR_COMPILE_WITH_WEBGL1_
\r
207 #undef _IRR_COMPILE_WITH_WEBGL1_
\r
209 #ifdef _IRR_COMPILE_WITH_WEBGL1_
\r
210 #define _IRR_COMPILE_WITH_OGLES2_ // it's a subset of OGL ES2, so always needed when using WebGL
\r
213 //! Define required options for OpenGL ES 2.0 drivers.
\r
214 #if defined(_IRR_COMPILE_WITH_OGLES2_)
\r
215 #if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(__EMSCRIPTEN__)
\r
216 #define _IRR_OGLES2_USE_EXTPOINTER_
\r
217 #ifndef _IRR_COMPILE_WITH_EGL_MANAGER_
\r
218 #define _IRR_COMPILE_WITH_EGL_MANAGER_
\r
220 #elif defined(_IRR_COMPILE_WITH_IOS_DEVICE_)
\r
221 #ifndef _IRR_COMPILE_WITH_EAGL_MANAGER_
\r
222 #define _IRR_COMPILE_WITH_EAGL_MANAGER_
\r
229 //! Define _IRR_COMPILE_WITH_X11_ to compile the Irrlicht engine with X11 support.
\r
230 /** If you do not wish the engine to be compiled with X11, comment this
\r
232 // Only used in LinuxDevice.
\r
233 #define _IRR_COMPILE_WITH_X11_
\r
234 #ifdef NO_IRR_COMPILE_WITH_X11_
\r
235 #undef _IRR_COMPILE_WITH_X11_
\r
238 #if defined(_IRR_LINUX_PLATFORM_) && defined(_IRR_COMPILE_WITH_X11_)
\r
239 //! XInput2 (library called Xi) is currently only used to support touch-input.
\r
240 #define _IRR_LINUX_X11_XINPUT2_
\r
241 #ifdef NO_IRR_LINUX_X11_XINPUT2_
\r
242 #undef _IRR_LINUX_X11_XINPUT2_
\r
245 //! X11 has by default only monochrome cursors, but using the Xcursor library we can also get color cursor support.
\r
246 //! If you have the need for custom color cursors on X11 then enable this and make sure you also link
\r
247 //! to the Xcursor library in your Makefile/Projectfile.
\r
248 //#define _IRR_LINUX_XCURSOR_
\r
249 #ifdef NO_IRR_LINUX_XCURSOR_
\r
250 #undef _IRR_LINUX_XCURSOR_
\r
256 #if defined(_IRR_SOLARIS_PLATFORM_)
\r
257 #undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
\r
261 #ifdef _IRR_WINDOWS_API_
\r
263 // To build Irrlicht as a static library, you must define _IRR_STATIC_LIB_ in both the
\r
264 // Irrlicht build, *and* in the user application, before #including <irrlicht.h>
\r
265 #ifndef _IRR_STATIC_LIB_
\r
266 #ifdef IRRLICHT_EXPORTS
\r
267 #define IRRLICHT_API __declspec(dllexport)
\r
269 #define IRRLICHT_API __declspec(dllimport)
\r
270 #endif // IRRLICHT_EXPORT
\r
272 #define IRRLICHT_API
\r
273 #endif // _IRR_STATIC_LIB_
\r
275 // Declare the calling convention.
\r
276 #if defined(_STDCALL_SUPPORTED)
\r
277 #define IRRCALLCONV __stdcall
\r
279 #define IRRCALLCONV __cdecl
\r
280 #endif // STDCALL_SUPPORTED
\r
282 #else // _IRR_WINDOWS_API_
\r
284 // Force symbol export in shared libraries built with gcc.
\r
285 #if defined(__GNUC__) && !defined(_IRR_STATIC_LIB_) && defined(IRRLICHT_EXPORTS)
\r
286 #define IRRLICHT_API __attribute__ ((visibility("default")))
\r
288 #define IRRLICHT_API
\r
291 #define IRRCALLCONV
\r
293 #endif // _IRR_WINDOWS_API_
\r
296 #define _IRR_COMPILE_WITH_GUI_
\r
297 #define _IRR_COMPILE_WITH_LIBJPEG_
\r
298 #define _IRR_COMPILE_WITH_LIBPNG_
\r
299 #define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
\r
300 #define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
\r
301 #define _IRR_COMPILE_WITH_B3D_LOADER_
\r
302 #define _IRR_COMPILE_WITH_X_LOADER_
\r
303 #define _IRR_COMPILE_WITH_OBJ_LOADER_
\r
304 #define _IRR_COMPILE_WITH_BMP_LOADER_
\r
305 #define _IRR_COMPILE_WITH_JPG_LOADER_
\r
306 #define _IRR_COMPILE_WITH_PNG_LOADER_
\r
307 #define _IRR_COMPILE_WITH_TGA_LOADER_
\r
308 #define _IRR_COMPILE_WITH_JPG_WRITER_
\r
309 #define _IRR_COMPILE_WITH_PNG_WRITER_
\r
310 #define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
\r
311 #define _IRR_COMPILE_WITH_ZLIB_
\r
312 #define __IRR_HAS_S64
\r
316 //! A few attributes are written in CSceneManager when _IRR_SCENEMANAGER_DEBUG is enabled
\r
317 // NOTE: Those attributes were used always until 1.8.0 and became a global define for 1.8.1
\r
318 // which is only enabled in debug because it had a large (sometimes >5%) impact on speed.
\r
319 // A better solution in the long run is to break the interface and remove _all_ attribute
\r
320 // access in functions like CSceneManager::drawAll and instead put that information in some
\r
321 // own struct/class or in CSceneManager.
\r
322 // See http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=48211 for the discussion.
\r
323 #define _IRR_SCENEMANAGER_DEBUG
\r
324 #ifdef NO_IRR_SCENEMANAGER_DEBUG
\r
325 #undef _IRR_SCENEMANAGER_DEBUG
\r
329 #endif // __IRR_COMPILE_CONFIG_H_INCLUDED__
\r