[DevC++] dll with directx 9.0c support available

A forum to store posts deemed exceptionally wise and useful
Post Reply
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I don't use MSVC++ currently. Just Linux and Dev-cpp (with the provided directx dev-pak).
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Post by kh_ »

Have any of you ever tried compiling with the d3d9.lib directly from the DX SDK ?

http://www.mingw.org/mingwfaq.shtml#faq-msvcdll

In Codeblocks (and DevC) with the mingw compiler I just add the DXSDK(oct. 2005) include and lib folders as usual, then d3d9.lib through the "build options/linker settings/link libraries/Add".
(note: it appears to require the full path or relative path)

Code: Select all

../../../DXSDK1005/Lib/x86/d3d9.lib
Also changed IrrCompileconfig.h to only compile dx9
I don't use any dev pack or convert anything.
Last edited by kh_ on Tue Jan 27, 2009 1:47 am, edited 17 times in total.
Wmbest2
Posts: 7
Joined: Thu Aug 19, 2004 10:33 pm
Location: PA, USA
Contact:

Post by Wmbest2 »

hello everyone,
I was just wondering if anyone could update the tutorial to work with the latest versions of irrlicht and directx

Thanks :D
FrostLord
Posts: 4
Joined: Mon Apr 11, 2005 5:04 pm

Post by FrostLord »

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 ;)
Wmbest2
Posts: 7
Joined: Thu Aug 19, 2004 10:33 pm
Location: PA, USA
Contact:

Post by Wmbest2 »

Worked like a charm! :D


By the way, I couldn't find the DX8 include either :cry:
kaloskalyre
Posts: 5
Joined: Mon Feb 20, 2006 8:41 am
Contact:

Post by kaloskalyre »

I can't get this to work. The DLL compiles without any errors but my program crashes when I try to use either version of directX (opengl and the software renderers work fine). It tells me that DirectX support was not compiled into the DLL.

I'm using:
CodeBlocks 1.0 Release Candidate 2
Irrlicht 1.2
Microsoft DirectX SDK, October 2006 version
Thomas_
Posts: 34
Joined: Mon May 08, 2006 1:51 am
Location: Corvallis/Eugene, Oregon

Post by Thomas_ »

I can't get this to work. The DLL compiles without any errors but my program crashes when I try to use either version of directX (opengl and the software renderers work fine). It tells me that DirectX support was not compiled into the DLL.
Yeah, i would like to know how to compile irrlicht 1.2 to allow DX8 and 9 too.
noreg
Posts: 158
Joined: Fri Jun 23, 2006 6:01 pm
Location: continental europe

Post by noreg »

I think you need an old sdk which still has dx8 support.
I wonder if it was for a technical reason that they removed it, as it is vital for indy programmers. XP comes with it and most users who do not regularly play games, never upgrade to DX9.
kaloskalyre
Posts: 5
Joined: Mon Feb 20, 2006 8:41 am
Contact:

Post by kaloskalyre »

I've tried multiple old sdks; i can only get dx9 to work (that wasn't working either when i first posted; don't know what i did wrong but i tried again and it worked). Irrlicht no longer tells me that directx8 support was not compiled into the dll, it just crashes.

As for why Microsoft removed it, it's their policy to dump old versions of their software after a certain amount of time, usually about 4-5 years, i think.
garrittg
Posts: 117
Joined: Wed Apr 20, 2005 6:17 pm
Location: Iowa, USA
Contact:

v1.2 compatible DLL

Post by garrittg »

here is a precompiled DX9/DX8 compatible v1.2 Irrlicht.dll and libIrrlicht.a.

EDIT: i want to reneg. i went back to the old way i was doing DX81 (not the devpak) and it worked! so here is a fully functional (at least in my tests) DX build.

http://www.gprogs.com/irrlicht.mod/IrrDX_v1_2.zip
Last edited by garrittg on Tue Dec 19, 2006 5:23 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Oh, so it's not only me having problems with DX8? I managed to follow the descriptions of how to use the mingw tools to create .a files, but unfortunately all my versions for DX8 crashed. So does the original version from the old directx devpak from dev-c++ site. Anyone knows why that is?
And thanks for your support garritg! It seems to help people a lot to get a working binary version. Maybe we can get a version with at least DX9 in one of the next releases.
garrittg
Posts: 117
Joined: Wed Apr 20, 2005 6:17 pm
Location: Iowa, USA
Contact:

Post by garrittg »

greetings hybrid :) been a while. ive been having DX81 fits since v1.0. after your last post it dawned on my that i hadnt tried the original way i was doing DX81 after i switched to codeblocks for this build. it rebuilt fine and it worked! please redownload the v1.2 DLL distro and give it a whirl.

along those lines, there really is no reason why the stock VC build of Irrlicht could not work in MingW as long as we get the exports right. from my research, i believe we just need to get the exports such that the VC name mangling does not occur. i only have VC6 and VC8Express so i dont have anything that can build a good DLL to try it out.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, using the Irrlicht-VC version with mingw would be another thing, but I am looking for a way to get Irrlicht to compile with DirectX support under mingw (dev-cpp or c::b would not really matter, I usually use the command line tools :wink: ). But converting the d3dx8ab.dll did not work, so I only used directX9 now. But for testing under Windows I'd really like to have DX8 as well.
garrittg
Posts: 117
Joined: Wed Apr 20, 2005 6:17 pm
Location: Iowa, USA
Contact:

Post by garrittg »

download the following file:

http://www.gprogs.com/irrlicht.mod/DX_81_a_files.zip

that is the required MingW .a file and the DLL for DX81. you will still need the DX81 SDK header files in order for it to work. change the settings of the project to add the DX81 SDK include folder, add the -D for DX8, and then add the lib libd3dx81ab.a to the project. everything should compile at that point.

i could not get the devpak to work at all.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, thanks. I'll try them.
Post Reply