vigns / slimdx

Automatically exported from code.google.com/p/slimdx
0 stars 0 forks source link

DirectInput change in September 2011 introduces wrong DIJoyState2 object offsets? #867

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the "what's changed" section of the September 2011 release, you mentioned 
several changes in DirectInput. Since I upgraded from March 2011 release to 
that one, I´m receiving incorrect object offsets when calling 
dInputDevice.GetObjects(DI.ObjectDeviceType.All).

Those objects, traditionally matched object offets inside the DIJoyState2 
structure, as defined in DInput.h. Now, they no longer do, what makes it harder 
to match them with the corresponding JoyState structure values. 

For instance, in a Logitech G27 steering wheel. The Clutch pedal is reporter in 
Slider_1, which has offset 28, and therefore the DeviceObjectInstance returned 
by the GetObjects method should have an offset value of 28 as well, but now it 
says 24. For the accelerator, which is reported in the "Y" DIJoyState2 element, 
the offset should be 4, but now it's 12. 

Can you give me a hand on this? Am I missing something, or there is another way 
to interpret the new offset?

Thanks in advance,

Iñaki Ayucar
DX MVP

Original issue reported on code.google.com by iayucart...@gmail.com on 5 Jun 2012 at 11:20

GoogleCodeExporter commented 9 years ago
Sorry, my mistake. Those offsets where like that before. Nevermind. 

Can someone please close this issue?

Thanks again, and go ahead with that amazing SlimDX !

Original comment by iayucart...@gmail.com on 5 Jun 2012 at 11:38

GoogleCodeExporter commented 9 years ago
GetObjects however returns DeviceObjectInstance structs, with Offset values 
that don't correspond those offsets used by GetObjectInfoByOffset methods. For 
instance, the clutch of the Logitech G27 has offset == 24 when calling 
GetObjects(), but it has Offset == 28 when calling GetObjectInfoByOffset. 

Original comment by iayucart...@gmail.com on 6 Jun 2012 at 1:22

GoogleCodeExporter commented 9 years ago
I took a look at this code. We simply pass the values returns from DI straight 
through. If it's returning weird values, it must be the underlying driver for 
some reason. Unfortunately I'm not a DI expert (it's a dying technology) so I 
can't give further insight into why this may be.

Original comment by Mike.Popoloski on 20 Jul 2012 at 4:34