diff --git a/changes.txt b/changes.txt index 53313974..f5809ef1 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,7 @@ Changes in 1.6 + - Allow Direct3D drivers in SDL, patch by Halifax + - Added compiler error when attempting to compile with VC6. - Use setWindowTextA in Windows device for WIN64 platform, posted by veegun diff --git a/lib/Win64-visualStudio/readme.txt b/lib/Win64-visualStudio/readme.txt index f6d67dec..7260e145 100644 --- a/lib/Win64-visualStudio/readme.txt +++ b/lib/Win64-visualStudio/readme.txt @@ -6,4 +6,6 @@ You'll have to download the Windows Platform SDK- http://msdn.microsoft.com/en-us/windows/bb980924.aspx When installing the platform SDK, make sure you install the x64 and -IA64 compilers from Developer Tools -> Visual C++ Compilers. \ No newline at end of file +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 diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 42c4d23f..02564ca1 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -27,8 +27,23 @@ namespace irr { namespace video { + + #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ + IVideoDriver* createDirectX8Driver(const core::dimension2d& 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& 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, io::IFileSystem* io); + #endif } // end namespace video } // end namespace irr @@ -64,16 +79,15 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param) Close = 1; } - SDL_SysWMinfo info; - SDL_VERSION(&info.version); + SDL_VERSION(&Info.version); - SDL_GetWMInfo(&info); + SDL_GetWMInfo(&Info); core::stringc sdlversion = "SDL Version "; - sdlversion += info.version.major; + sdlversion += Info.version.major; sdlversion += "."; - sdlversion += info.version.minor; + sdlversion += Info.version.minor; sdlversion += "."; - sdlversion += info.version.patch; + sdlversion += Info.version.patch; Operator = new COSOperator(sdlversion.c_str()); os::Printer::log(sdlversion.c_str(), ELL_INFORMATION); @@ -201,8 +215,39 @@ void CIrrDeviceSDL::createDriver() switch(CreationParams.DriverType) { 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: - 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; case video::EDT_SOFTWARE: diff --git a/source/Irrlicht/CIrrDeviceSDL.h b/source/Irrlicht/CIrrDeviceSDL.h index cf1d62eb..ee3a201f 100644 --- a/source/Irrlicht/CIrrDeviceSDL.h +++ b/source/Irrlicht/CIrrDeviceSDL.h @@ -17,6 +17,7 @@ #include "ICursorControl.h" #include +#include namespace irr { @@ -207,6 +208,7 @@ namespace irr }; core::array KeyMap; + SDL_SysWMinfo Info; }; } // end namespace irr