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 #include "IrrCompileConfig.h"
\r
7 static const char* const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Gebhardt"; // put string in binary
\r
10 #include <windows.h>
\r
11 #if defined(_DEBUG) && !defined(__GNUWIN32__)
\r
16 #include "irrlicht.h"
\r
17 #ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
\r
18 #include "CIrrDeviceWin32.h"
\r
21 #ifdef _IRR_COMPILE_WITH_X11_DEVICE_
\r
22 #include "CIrrDeviceLinux.h"
\r
25 #ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
\r
26 #include "CIrrDeviceOSX.h"
\r
29 #ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
\r
30 #include "CIrrDeviceSDL.h"
\r
33 #ifdef _IRR_COMPILE_WITH_IOS_DEVICE_
\r
34 #include "CIrrDeviceiOS.h"
\r
37 #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
\r
38 #include "Android/CIrrDeviceAndroid.h"
\r
43 //! stub for calling createDeviceEx
\r
44 IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice(video::E_DRIVER_TYPE driverType,
\r
45 const core::dimension2d<u32>& windowSize,
\r
46 u32 bits, bool fullscreen,
\r
47 bool stencilbuffer, bool vsync, IEventReceiver* res)
\r
49 (void)copyright; // prevent unused variable warning
\r
51 SIrrlichtCreationParameters p;
\r
52 p.DriverType = driverType;
\r
53 p.WindowSize = windowSize;
\r
55 p.Fullscreen = fullscreen;
\r
56 p.Stencilbuffer = stencilbuffer;
\r
58 p.EventReceiver = res;
\r
60 return createDeviceEx(p);
\r
63 extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(const SIrrlichtCreationParameters& params)
\r
66 IrrlichtDevice* dev = 0;
\r
68 #ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
\r
69 if (params.DeviceType == EIDT_WIN32 || (!dev && params.DeviceType == EIDT_BEST))
\r
70 dev = new CIrrDeviceWin32(params);
\r
73 #ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
\r
74 if (params.DeviceType == EIDT_OSX || (!dev && params.DeviceType == EIDT_BEST))
\r
75 dev = new CIrrDeviceMacOSX(params);
\r
78 #ifdef _IRR_COMPILE_WITH_X11_DEVICE_
\r
79 if (params.DeviceType == EIDT_X11 || (!dev && params.DeviceType == EIDT_BEST))
\r
80 dev = new CIrrDeviceLinux(params);
\r
83 #ifdef _IRR_COMPILE_WITH_IOS_DEVICE_
\r
84 if (params.DeviceType == EIDT_IOS || (!dev && params.DeviceType == EIDT_BEST))
\r
85 dev = new CIrrDeviceiOS(params);
\r
88 #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
\r
89 if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST))
\r
90 dev = new CIrrDeviceAndroid(params);
\r
93 #ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
\r
94 if (params.DeviceType == EIDT_SDL || (!dev && params.DeviceType == EIDT_BEST))
\r
95 dev = new CIrrDeviceSDL(params);
\r
98 if (dev && !dev->getVideoDriver() && params.DriverType != video::EDT_NULL)
\r
100 dev->closeDevice(); // destroy window
\r
101 dev->run(); // consume quit message
\r
111 const matrix4 IdentityMatrix(matrix4::EM4CONST_IDENTITY);
\r
116 SMaterial IdentityMaterial;
\r
119 } // end namespace irr
\r
122 #if defined(_IRR_WINDOWS_API_) && !defined(_IRR_STATIC_LIB_)
\r
124 BOOL APIENTRY DllMain( HANDLE hModule,
\r
125 DWORD ul_reason_for_call,
\r
126 LPVOID lpReserved )
\r
128 // _crtBreakAlloc = 139;
\r
130 switch (ul_reason_for_call)
\r
132 case DLL_PROCESS_ATTACH:
\r
133 #if defined(_DEBUG) && !defined(__GNUWIN32__)
\r
134 _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF);
\r
137 case DLL_THREAD_ATTACH:
\r
138 case DLL_THREAD_DETACH:
\r
139 case DLL_PROCESS_DETACH:
\r
145 #endif // defined(_IRR_WINDOWS_)
\r