DirectX and Borland

Up ] OpenGL ] [ DirectX ] Miscellaneous ] BMGLib ]


Using DirectX with BC++ 5.0x

First, you need to order the DirectX SDK from Microsoft's web site.  The current version is 8.0.  Microsoft will ship you a CD-ROM containing the SDK for $8.65 (US).

Before you install the SDK, read the article "Borland C++ 5 Setup for DirectX 5" by Bruce J. Veazie.  This article tells you how to install the SDK for BC++.  It also tells you how to compile, link, and run the 60+ examples that are contained in the SDK.  The  (version 5.0) SDK contains Borland compatible libraries (but they are not where you expect them to be!!!).  Also, Microsoft's floating point exception handlers are not compatible with BC++.  Bruce's article tells you how to overcome these hurdles.  (I don't know if this article applies to versions of DX greater than 5.0.)

A frequent problem that people have is "unresolved externals...".  You need to add the appropriate DX libraries to your project.   The linker will not automatically find them even if you put them in the BC5\LIBS folder.  You also need to add DXGUID.LIB to your projects.  DXGUID defines the DX interfaces.  For DX 5, download the DXGUID.LIB file from Jovo's web page.  This updated library contains functions that Microsoft left out of the Borland libraries.   I have not tried DX6 or DX7 with BC++.  I have not seen any complaints about unresolved externals in these versions, so I assume that the Inprise/Borland version is complete.

I have rewritten several of the DX5 Direct3D Retained Mode examples using OWL.   You may download these examples from here.

The D3DX.LIB in DX 7 is not compatible with BC++ or BCB.  MS "forgot" to provide a Borland compatible version of this library.  You will need to write a DLL wrapper for this library using VC++.  The DLL must export all of the functions.  Then use IMPLIB to create a Borland compatible import library for the DLL.

Borland tells you how to set up BCB 4 to compile the Direct3D Immediate Mode examples that come with the DX7 SDK at its web site.   Michael Foetsch has a tutorial that shows you how to use DirectX with BCB.  You can also find useful information in the DirectX newsgroup .

I have seen several posts complaining about the lack of Borland compatible DX8.0 libraries in the newsgroups.  Zaqhaq and Michael Foetsch have posted Borland compatible DX8.0 libraries at their sites.  Michael's libraries include the static libraries: d3dx.lib, d3dxd.lib, and d3dx8.lib.  People needing assistance with DirectX 8.1 should visit the Clootie Graphics Pages.

Other useful DirectX links can be found on my Links page.  My opinions about "DirectX vs OpenGL" can be found here.