aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/Irrlicht.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/Irrlicht.cpp')
-rw-r--r--libraries/irrlicht-1.8/source/Irrlicht/Irrlicht.cpp154
1 files changed, 154 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/Irrlicht.cpp b/libraries/irrlicht-1.8/source/Irrlicht/Irrlicht.cpp
new file mode 100644
index 0000000..da0043b
--- /dev/null
+++ b/libraries/irrlicht-1.8/source/Irrlicht/Irrlicht.cpp
@@ -0,0 +1,154 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#include "IrrCompileConfig.h"
6
7static const char* const copyright = "Irrlicht Engine (c) 2002-2012 Nikolaus Gebhardt";
8
9#ifdef _IRR_WINDOWS_
10 #include <windows.h>
11 #if defined(_DEBUG) && !defined(__GNUWIN32__) && !defined(_WIN32_WCE)
12 #include <crtdbg.h>
13 #endif // _DEBUG
14#endif
15
16#include "irrlicht.h"
17#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
18#include "CIrrDeviceWin32.h"
19#endif
20
21#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
22#include "MacOSX/CIrrDeviceMacOSX.h"
23#endif
24
25#ifdef _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_
26#include "CIrrDeviceWinCE.h"
27#endif
28
29#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
30#include "CIrrDeviceLinux.h"
31#endif
32
33#ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
34#include "CIrrDeviceSDL.h"
35#endif
36
37#ifdef _IRR_COMPILE_WITH_FB_DEVICE_
38#include "CIrrDeviceFB.h"
39#endif
40
41#ifdef _IRR_COMPILE_WITH_CONSOLE_DEVICE_
42#include "CIrrDeviceConsole.h"
43#endif
44
45namespace irr
46{
47 //! stub for calling createDeviceEx
48 IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice(video::E_DRIVER_TYPE driverType,
49 const core::dimension2d<u32>& windowSize,
50 u32 bits, bool fullscreen,
51 bool stencilbuffer, bool vsync, IEventReceiver* res)
52 {
53 SIrrlichtCreationParameters p;
54 p.DriverType = driverType;
55 p.WindowSize = windowSize;
56 p.Bits = (u8)bits;
57 p.Fullscreen = fullscreen;
58 p.Stencilbuffer = stencilbuffer;
59 p.Vsync = vsync;
60 p.EventReceiver = res;
61
62 return createDeviceEx(p);
63 }
64
65 extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(const SIrrlichtCreationParameters& params)
66 {
67
68 IrrlichtDevice* dev = 0;
69
70#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
71 if (params.DeviceType == EIDT_WIN32 || (!dev && params.DeviceType == EIDT_BEST))
72 dev = new CIrrDeviceWin32(params);
73#endif
74
75#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
76 if (params.DeviceType == EIDT_OSX || (!dev && params.DeviceType == EIDT_BEST))
77 dev = new CIrrDeviceMacOSX(params);
78#endif
79
80#ifdef _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_
81 if (params.DeviceType == EIDT_WINCE || (!dev && params.DeviceType == EIDT_BEST))
82 dev = new CIrrDeviceWinCE(params);
83#endif
84
85#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
86 if (params.DeviceType == EIDT_X11 || (!dev && params.DeviceType == EIDT_BEST))
87 dev = new CIrrDeviceLinux(params);
88#endif
89
90#ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
91 if (params.DeviceType == EIDT_SDL || (!dev && params.DeviceType == EIDT_BEST))
92 dev = new CIrrDeviceSDL(params);
93#endif
94
95#ifdef _IRR_COMPILE_WITH_FB_DEVICE_
96 if (params.DeviceType == EIDT_FRAMEBUFFER || (!dev && params.DeviceType == EIDT_BEST))
97 dev = new CIrrDeviceFB(params);
98#endif
99
100#ifdef _IRR_COMPILE_WITH_CONSOLE_DEVICE_
101 if (params.DeviceType == EIDT_CONSOLE || (!dev && params.DeviceType == EIDT_BEST))
102 dev = new CIrrDeviceConsole(params);
103#endif
104
105 if (dev && !dev->getVideoDriver() && params.DriverType != video::EDT_NULL)
106 {
107 dev->closeDevice(); // destroy window
108 dev->run(); // consume quit message
109 dev->drop();
110 dev = 0;
111 }
112
113 return dev;
114 }
115
116namespace core
117{
118 const matrix4 IdentityMatrix(matrix4::EM4CONST_IDENTITY);
119 irr::core::stringc LOCALE_DECIMAL_POINTS(".");
120}
121
122namespace video
123{
124 SMaterial IdentityMaterial;
125}
126
127} // end namespace irr
128
129
130#if defined(_IRR_WINDOWS_API_)
131
132BOOL APIENTRY DllMain( HANDLE hModule,
133 DWORD ul_reason_for_call,
134 LPVOID lpReserved )
135{
136 // _crtBreakAlloc = 139;
137
138 switch (ul_reason_for_call)
139 {
140 case DLL_PROCESS_ATTACH:
141 #if defined(_DEBUG) && !defined(__GNUWIN32__) && !defined(__BORLANDC__) && !defined (_WIN32_WCE) && !defined (_IRR_XBOX_PLATFORM_)
142 _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF);
143 #endif
144 break;
145 case DLL_THREAD_ATTACH:
146 case DLL_THREAD_DETACH:
147 case DLL_PROCESS_DETACH:
148 break;
149 }
150 return TRUE;
151}
152
153#endif // defined(_IRR_WINDOWS_)
154