Re: [AD] win directx Joystick driver

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


>The problem is that, according to the DirectX docs, you must target only
>one version of DirectInput at compile time

Of course, a DirectX A compiled program runs flawlessly with the DirectX B
runtime libs if B>=A.

> This seems rather nonsensical. Could we get around it by compiling one
> DLL for each discrete version of DirectInput that we need to support,
> and then dynamically loading the correct DLL in the main Allegro
> library?

Yes, that should be a solution. We can keep a DirectX 3 based core dll and
put aside into another dll all the DirectX 5 stuff.

I can think of three cases:
- a DirectX 5 compiled program using only the DirectX 3 interface can run
with the DirectX 3 runtime libs: all is fine; otherwise,
- as the DirectX version you want your program to be compiled for must be
defined for each source file, we could target DirectX 3 in all source files
but the joystick driver one; otherwise,
- use a separate DirectX 5 specific dll.

> If we can do it this way, why didn't MS implement some such
> system in the first place?

Do you mean providing multiple dlls like dinput1.dll, dinput2.dll, ... ?
That's essentially what COM does: you can retrieve from the DirectX 8
version of dinput.dll all the previous DirectInput interfaces.

The problem is really at compile time because, whereas COM roughly solves
the dynamic interface compatibility problem, the hard-coded data structures
are statically tied to a specific DirectX version.

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/