Re: [AD] Unknown joystick axis problem under Windows

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


> It indeed fixed part of the bug: one "bad" axis is gone.

Nice.  I commited the patch to mainline.

> There's another bug I cannot explain with sliders handling, however.
> After a little research, I noticed that rglSlider[] data were always
> set to 0. My joystick here has 1 slider, accessed via rglSlider[0]
> using DirectInput.
>
> I ran the joystick example provided with DirectX 8 SDK, which display
> all joystick state values.
> I can move one of my stick axis and see the slider 0 value moving in
> the specified range (-1000 to 1000 in the example).
> This same slider is detected by Allegro, but its value always stays
> to 0.
>
> I have no idea why it is so.

Possible explanation: the slider has a fixed range, which cannot be altered 
via the SetPropery method.

> I tried changing to the extended data format: using the DIJOYSTATE2
> structure, and passing c_dfDIJoystick2 to
> IDirectInputDevice2_SetDataFormat(), but it did not help.

Since you have already played with the code, could you add a call to the 
GetProperty method on the slider object with DIPROP_RANGE, right after the 
two calls to the SetProperty method in joystick_enum_callback?  What is the 
returned range?

> One difference is that the example has DirectInput version 0x0800,
> whereas Allegro uses 0x0500. Perhaps version 0x0500 does not handle
> sliders well, or differently ?

I hope not.

> I don't know much about DirectX, but:
>
> WDXVER.C, WKEYBD.C and WMOUSE.C have the DIRECTINPUT_VERSION definition
> set to 0x0300, while WJOYDX.C have it set to 0x0500.
>
> Does using different versions API is well supported?

If you believe Microsoft, perfectly.  DirectInput objects are COM objects, so 
they can expose whatever interfaces you can think of (well, with some limits 
though :-) to the world.  This means that a DirectInput 8 object can be 
accessed through all the previous DirectInput interfaces.

-- 
Eric Botcazou




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