June 22nd 2004 the website G-Productions was launched. This site was dedicated to my very own afford to create a game engine using DirectX. I was not a friend of the Visual Studio that time since I could not afford this (it was not that cheap that time), so an alternative compiler had to be found. Soon I stepped over Dev-Cpp. This was a very complete and full functional IDE which uses the MinGW compiler. Cool was my first thought, but the first problems were soon knocking on the door. Those of you who ever tried to use DirectX with the MinGW compiler know what I’m talking about. A bunch of compiler errors say hello if you include a DirectX header file.
Teaching a compiler the Microsoft way
Searching the www I could not find any way how to use the DirectX SDK with the MinGW compiler. A DirectX DevPak was available but it included only the DirectX Graphics component of SDK and it was not very complete (imagine the D3DX functions library). On several forums and bb’s people already had posted problems with using MinGW and DirectX SDK (that time people referred to the DX SDK 8.1). Soon I realized that there was the need of an adequate solution. Download the DX SDK and let’s get to work I thought and so I did. After downloading the DirectX SDK 9.0 I started reading through the compiler tools documentation. After a short time I got all the DirectX Graphics issues fixed and I had a stable release of the graphics library of the SDK. Most important thing was, that it was full usable and full functional with Dev-Cpp.
Next step: DirectInput
Next task on my list was the DirectInput library. Some fixes here some fixes there and converting the library and here you are with a complete DirectInput library for MinGW. Easy I thought, let’s get to the sound stuff.
The audience is listening
That time for audio the DX SDK provided the DirectSound and DirectMusic library. While DirectMusic was easy to convert, DirectSound made some problems because of the use of some defines which were not so easy to work with.
The biggest problem when working with the MinGW compiler tools is also the best feature. The MinGW compiler is an ANSII compliant compiler and allows only ANSII compliant C++. The complete DX SDK contains partial non-ANSII-compliant code. That was the issue most people complaint about. Within the DXSDK a script language (IDL) was used what was also difficult to change that MinGW could work with it. Most work with the DXSDK was changing some parts of the header files, mainly fixing scoping problems and/or rewriting the IDL parts and the header files worked very well with MinGW. But what I faced with the DirectShow part was terrible. Let’s say I needed one month of work to make DirectX Graphics, DirectSound, DirectMusic, DirectInput and DirectPlay work with MinGW I needed at least 3 more months to convert the DirectShow stuff. My intention was to release the most complete DirectX.DevPak available so people could use it for their applications. My intention was also that my DevPak should compile out-of-the-box. So I didn’t loose a word on my DevPak until the DirectShow part was also converted. The problem was that most tutorials and samples used the BaseClasses, a static library which wrapped many things up and allowed the developer to render videos on textures or for DirectDraw on surfaces. These BaseClasses library was nearly impossible to change for MinGW. Finally with some tweaks DirectShow was usable with MinGW and I included the samples and provided it for download.
Past and future
Four years I spent more time on keeping updated this DirectX.DevPak, which was originally designed to help me and my team developing the blueEngine, than on working on my own game engine (Microsoft loved me so much that they began releasing a monthly update on the DX 9.0 SDK). The DirectX.DevPak became an own single project that took most of my time.
Since the release of the Visual Studio Express Editions especially the XNA Express version I began asking myself if it would make any sense of continue the work on the DevPak and release any further updates. The reason why I started to work with Dev-Cpp and the MinGW compiler was that I didn’t have the money to buy a Visual Studio C++ 6.0 version. Now Microsoft introduced the Visual Studio Express editions giving such a great development environment away for free. Why should someone still need an updated DirectX.DevPak? I downloaded the DirectX SDK March 2008 and tried to look how much work it would be to convert it. So many changes, monthly updates, some functions were dropped others were introduced…
There definitely won’t be be any more updates on the DirectX.DevPak. The last release is available here. The changes on the DXSDK are too many. I would have to convert the complete DXSDK March 2008 and I simply don’t have the time for this. It was great to work on this DevPak you can learn so much about C++ when having to work with compiler and linker issues, different static library formats. I think this also improved the way I’m programming in C++ and of course influenced the way I think about open-source projects a standardized static and dynamic library format etc.