I have recently switched to CODE::BLOCKS from DevC++ and I tried to recompile Irrlicht 1.2 with DirectX9 support.
After a few tries I suspected that the Devpak for DevC++ I was using was too old to work with latest DirectX functions, so I tried to use the latest DirectX SDK (in this case, october 2006 release), as HF suggested a few posts above this one.
Since I use Mingw, I have converted the .libs files contained in the SDK to .a files with REIMP (detailed instructions on REIMP in gfxstyler's post
HERE).. all worked flawlessly and the new .a libs works perfectly with Irrlicht 1.2.
So:
- Download latest DirectX SDK from
Microsoft site
- decompress the archive in a folder (i.e.: c:\dxsdk_oct06)
- use REIMP (it is included in the MinGW tools in CODE::BLOCKS) to convert d3d9.lib to libd3d9.a
- now add the INCLUDE folder of the DirectX SDK to your compiler directories or directly copy the files in your INCLUDE folder (as you prefer) and add the converted libd3d9.a to your linker options
Now let's configure Irrlicht to compile with DirectX9:
- add -D_IRR_COMPILE_WITH_DIRECT3D_9_ to your linker settings
- open the file IrrCompileConfig.h and comment out the last part of the file:
- Code: Select all
#ifdef _MSC_VER
#if (_MSC_VER < 1300 && !defined(__GNUC__))
#undef _IRR_COMPILE_WITH_DIRECT3D_9_
#pragma message("Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.")
#endif
#endif
WARNING: do NOT comment out the #endif located on the last line, just the two above that one.
- now build your new Irrlicht engine!
This way, you will have working Irrlicht.DLL, libIrrlicht.a and libIrrlicht.def with DirectX9 support.
Adding DirectX8 support would be easy, because you'll have just to convert with REIMP the d3d8.lib to libd3d8.a and find suitable includes (in the latest SDK the includes for DX8 seems to be missing... or maybe I haven't found them ?)
This is just to summarize a lot of posts and very good suggestions all around the forums, hope it helps!
PS: and don't forget to keep your installed Directx up to date too
