Commit be6fd3df authored by bitplane's avatar bitplane

Added D3D support in SDL device, posted by Halifax. Also updated readme in...

Added D3D support in SDL device, posted by Halifax. Also updated readme in Win64 dir to complain about lack of 64-bit support in VC Express.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2286 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 64f0b592
Changes in 1.6 Changes in 1.6
- Allow Direct3D drivers in SDL, patch by Halifax
- Added compiler error when attempting to compile with VC6. - Added compiler error when attempting to compile with VC6.
- Use setWindowTextA in Windows device for WIN64 platform, posted by veegun - Use setWindowTextA in Windows device for WIN64 platform, posted by veegun
......
...@@ -7,3 +7,5 @@ http://msdn.microsoft.com/en-us/windows/bb980924.aspx ...@@ -7,3 +7,5 @@ http://msdn.microsoft.com/en-us/windows/bb980924.aspx
When installing the platform SDK, make sure you install the x64 and When installing the platform SDK, make sure you install the x64 and
IA64 compilers from Developer Tools -> Visual C++ Compilers. IA64 compilers from Developer Tools -> Visual C++ Compilers.
If you're using VC Express you will only be able to compile from the
command line.
\ No newline at end of file
...@@ -27,8 +27,23 @@ namespace irr ...@@ -27,8 +27,23 @@ namespace irr
{ {
namespace video namespace video
{ {
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
IVideoDriver* createDirectX8Driver(const core::dimension2d<u32>& screenSize, HWND window,
u32 bits, bool fullscreen, bool stencilbuffer, io::IFileSystem* io,
bool pureSoftware, bool highPrecisionFPU, bool vsync, u8 antiAlias);
#endif
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
IVideoDriver* createDirectX9Driver(const core::dimension2d<u32>& screenSize, HWND window,
u32 bits, bool fullscreen, bool stencilbuffer, io::IFileSystem* io,
bool pureSoftware, bool highPrecisionFPU, bool vsync, u8 antiAlias);
#endif
#ifdef _IRR_COMPILE_WITH_OPENGL_
IVideoDriver* createOpenGLDriver(const SIrrlichtCreationParameters& params, IVideoDriver* createOpenGLDriver(const SIrrlichtCreationParameters& params,
io::IFileSystem* io); io::IFileSystem* io);
#endif
} // end namespace video } // end namespace video
} // end namespace irr } // end namespace irr
...@@ -64,16 +79,15 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param) ...@@ -64,16 +79,15 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
Close = 1; Close = 1;
} }
SDL_SysWMinfo info; SDL_VERSION(&Info.version);
SDL_VERSION(&info.version);
SDL_GetWMInfo(&info); SDL_GetWMInfo(&Info);
core::stringc sdlversion = "SDL Version "; core::stringc sdlversion = "SDL Version ";
sdlversion += info.version.major; sdlversion += Info.version.major;
sdlversion += "."; sdlversion += ".";
sdlversion += info.version.minor; sdlversion += Info.version.minor;
sdlversion += "."; sdlversion += ".";
sdlversion += info.version.patch; sdlversion += Info.version.patch;
Operator = new COSOperator(sdlversion.c_str()); Operator = new COSOperator(sdlversion.c_str());
os::Printer::log(sdlversion.c_str(), ELL_INFORMATION); os::Printer::log(sdlversion.c_str(), ELL_INFORMATION);
...@@ -201,8 +215,39 @@ void CIrrDeviceSDL::createDriver() ...@@ -201,8 +215,39 @@ void CIrrDeviceSDL::createDriver()
switch(CreationParams.DriverType) switch(CreationParams.DriverType)
{ {
case video::EDT_DIRECT3D8: case video::EDT_DIRECT3D8:
#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
VideoDriver = video::createDirectX8Driver(CreationParams.WindowSize, Info.window,
CreationParams.Bits, CreationParams.Fullscreen, CreationParams.Stencilbuffer,
FileSystem, false, CreationParams.HighPrecisionFPU, CreationParams.Vsync,
CreationParams.AntiAlias);
if (!VideoDriver)
{
os::Printer::log("Could not create DIRECT3D8 Driver.", ELL_ERROR);
}
#else
os::Printer::log("DIRECT3D8 Driver was not compiled into this dll. Try another one.", ELL_ERROR);
#endif // _IRR_COMPILE_WITH_DIRECT3D_8_
break;
case video::EDT_DIRECT3D9: case video::EDT_DIRECT3D9:
os::Printer::log("This driver is not available in SDL.", ELL_ERROR); #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
VideoDriver = video::createDirectX9Driver(CreationParams.WindowSize, Info.window,
CreationParams.Bits, CreationParams.Fullscreen, CreationParams.Stencilbuffer,
FileSystem, false, CreationParams.HighPrecisionFPU, CreationParams.Vsync,
CreationParams.AntiAlias);
if (!VideoDriver)
{
os::Printer::log("Could not create DIRECT3D9 Driver.", ELL_ERROR);
}
#else
os::Printer::log("DIRECT3D9 Driver was not compiled into this dll. Try another one.", ELL_ERROR);
#endif // _IRR_COMPILE_WITH_DIRECT3D_9_
break; break;
case video::EDT_SOFTWARE: case video::EDT_SOFTWARE:
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "ICursorControl.h" #include "ICursorControl.h"
#include <SDL/SDL.h> #include <SDL/SDL.h>
#include <SDL/SDL_syswm.h>
namespace irr namespace irr
{ {
...@@ -207,6 +208,7 @@ namespace irr ...@@ -207,6 +208,7 @@ namespace irr
}; };
core::array<SKeyMap> KeyMap; core::array<SKeyMap> KeyMap;
SDL_SysWMinfo Info;
}; };
} // end namespace irr } // end namespace irr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment