View Full Version : use directx in delphi/fpc applications without helper dll?

06-05-2007, 04:58 PM
I am looking into ways to use directx from delphi. So far i found clootie
http://www.clootie.ru/articles/HowToCompile_ObjectPascal.html. But it seems to use a helper dll? Is that realy needed and why? Are there ways using direct3d without them?

Thanks for your answers in advance.

06-05-2007, 05:53 PM
Have you tried Asphyre? http://www.afterwarp.net Howevr there is still helper dll needed. My knowledge is not sufficient to tell why;)

06-05-2007, 06:26 PM
Asphyre 3.1 doesn't need any additional DLLs. The newest release Asphyre 4 requires D3DX9 to compile shaders.

06-05-2007, 07:36 PM
These are actually not a helper DLL's right now (seems I had to make a heavy update on instructions page). Right now every D3D9 or D3D10 application (these includes Delphi, FPC and C++ compilers) compiled against recent DirectX SDK will require D3DX dll if you are using any D3DX functions in your application. Probably many of you already heard user complains: "My new game/patch fails to run saying that it needs d3dx9_XX.dll?!!". In many cases you can avoid using D3DX in you project, but the moment you start to use HLSL shaders - you had to redistribute DirectX redist (which includes D3DX dll) with your project/game, as compiler is located in one of d3dx9_XX.dll libraries.

And believe me or not: D3D10 requires you to use HLSL shaders, as there are no assembly shaders or fixed function pipeline anymore. Any D3D10 program is tied to supply D3DX10_[33].dll (or they can use bugged compiler in d3dx10.dll provided with every Vista install).

:idea: Basically -> you should not be afraid to use D3DX dlls, as everybody has to do this now.

07-05-2007, 07:20 PM
ok d3dx9 comes in multiple versions (patches) that are not automaticaly updated to end users system. So the dll's that are for download on clootie's site are from the directx sdk. Hmm why does microsoft not update them automaticaly? Or allow for a call to a generic d3dx9 dll that automaticaly uses the latest dll? Thanks Microsoft. :twisted:

Ok so i just need to copy them to the system dir if they are not already there or can they just be in the application dir?

08-05-2007, 09:48 AM
Well, it's tough question :D

Originally MS intention was/is to avoid bug exploration (remember JPEG decompressor issue - that library contained buffer overflog bug and was embedded in many MS products). So yes, in theory MS wants to update bugged versions of D3DX9 with Windows Update (but AFAIK there was not any bugs found in it). And you MS can't just substitute generic D3DX9.dll as each new version have it's own quirks (especially in HLSL compiler). So just replacing DLL will lead to many games stop working correctly - this definetly is not what MS wants! 8)

On the other side you by yourself can check availability of preinstalled D3DX9_xx.dll's and choose to use one of the existing instead of installing your own - but in this case all compatibility testing burden is on your side!

PS. DirectX EULA prohibits copying D3DX dlls in application folder and requires app to install them with generic DX installed (not just by copying them with your own one) - this one is intended to make sure that app is always using bug-free version in System32 dir (that is controlled/updated by MS). On the other side - I've seen commertial games that placed this DLL in their own folder...