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
6 static const char* const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Gebhardt"; // put string in binary
\r
10 #if defined(_DEBUG) && !defined(__GNUWIN32__)
\r
15 #include "irrlicht.h"
\r
16 #ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
\r
17 #include "CIrrDeviceWin32.h"
\r
20 #ifdef _IRR_COMPILE_WITH_X11_DEVICE_
\r
21 #include "CIrrDeviceLinux.h"
\r
24 #ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
\r
25 #include "CIrrDeviceOSX.h"
\r
28 #ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
\r
29 #include "CIrrDeviceSDL.h"
\r
32 #ifdef _IRR_COMPILE_WITH_IOS_DEVICE_
\r
33 #include "CIrrDeviceiOS.h"
\r
36 #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
\r
37 #include "Android/CIrrDeviceAndroid.h"
\r
42 //! stub for calling createDeviceEx
\r
43 IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice(video::E_DRIVER_TYPE driverType,
\r
44 const core::dimension2d<u32>& windowSize,
\r
45 u32 bits, bool fullscreen,
\r
46 bool stencilbuffer, bool vsync, IEventReceiver* res)
\r
48 (void)copyright; // prevent unused variable warning
\r
50 SIrrlichtCreationParameters p;
\r
51 p.DriverType = driverType;
\r
52 p.WindowSize = windowSize;
\r
54 p.Fullscreen = fullscreen;
\r
55 p.Stencilbuffer = stencilbuffer;
\r
57 p.EventReceiver = res;
\r
59 return createDeviceEx(p);
\r
62 extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(const SIrrlichtCreationParameters& params)
\r
65 IrrlichtDevice* dev = 0;
\r
67 #ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
\r
68 if (params.DeviceType == EIDT_WIN32 || (!dev && params.DeviceType == EIDT_BEST))
\r
69 dev = new CIrrDeviceWin32(params);
\r
72 #ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
\r
73 if (params.DeviceType == EIDT_OSX || (!dev && params.DeviceType == EIDT_BEST))
\r
74 dev = new CIrrDeviceMacOSX(params);
\r
77 #ifdef _IRR_COMPILE_WITH_X11_DEVICE_
\r
78 if (params.DeviceType == EIDT_X11 || (!dev && params.DeviceType == EIDT_BEST))
\r
79 dev = new CIrrDeviceLinux(params);
\r
82 #ifdef _IRR_COMPILE_WITH_IOS_DEVICE_
\r
83 if (params.DeviceType == EIDT_IOS || (!dev && params.DeviceType == EIDT_BEST))
\r
84 dev = new CIrrDeviceiOS(params);
\r
87 #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
\r
88 if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST))
\r
89 dev = new CIrrDeviceAndroid(params);
\r
92 #ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
\r
93 if (params.DeviceType == EIDT_SDL || (!dev && params.DeviceType == EIDT_BEST))
\r
94 dev = new CIrrDeviceSDL(params);
\r
97 if (dev && !dev->getVideoDriver() && params.DriverType != video::EDT_NULL)
\r
99 dev->closeDevice(); // destroy window
\r
100 dev->run(); // consume quit message
\r
110 const matrix4 IdentityMatrix(matrix4::EM4CONST_IDENTITY);
\r
115 SMaterial IdentityMaterial;
\r
118 } // end namespace irr
\r
121 #if defined(_IRR_WINDOWS_API_) && !defined(_IRR_STATIC_LIB_)
\r
123 BOOL APIENTRY DllMain( HANDLE hModule,
\r
124 DWORD ul_reason_for_call,
\r
125 LPVOID lpReserved )
\r
127 // _crtBreakAlloc = 139;
\r
129 switch (ul_reason_for_call)
\r
131 case DLL_PROCESS_ATTACH:
\r
132 #if defined(_DEBUG) && !defined(__GNUWIN32__)
\r
133 _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF);
\r
136 case DLL_THREAD_ATTACH:
\r
137 case DLL_THREAD_DETACH:
\r
138 case DLL_PROCESS_DETACH:
\r
144 #endif // defined(_IRR_WINDOWS_)
\r