http://msdn.microsoft.com/en-us/library/ee417014%28v=vs.85%29.aspx
Some game developers might not end up adding it, or not adding it correctly. Maybe Xinput can be emulated, for these games?
Like Joystick X -> sThumbLX, Joystick Y -> sThumbLY, Joystick Rx -> sThumbRX, Joystick Ry -> sThumbRY
The LONGs rounded down to SHORTs.
Just to support games made for both Windows and the Xbox 360 console.
http://en.wikipedia.org/wiki/List_of_XInput_games
Taking a look at the structures of the APIs, I can see that Xinput really means XboxController Input (limited to 4 axis, 2bytes each)
XINPUT_STATE Structure
http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.reference.xinput_state%28v=vs.85%29.aspx
XINPUT_GAMEPAD structure containing the current state of an Xbox 360 Controller.
XINPUT_GAMEPAD Structure
http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.reference.xinput_gamepad%28v=vs.85%29.aspx
- Code: Select all
typedef struct _XINPUT_GAMEPAD {
WORD wButtons;
BYTE bLeftTrigger;
BYTE bRightTrigger;
SHORT sThumbLX;
SHORT sThumbLY;
SHORT sThumbRX;
SHORT sThumbRY;
} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD;
Xinput has only 1/2 of the axis as DirectInput's DIJOYSTATE.
Each with only half the resolution (SHORT-2 bytes, LONG-4 bytes.)
DIJOYSTATE Structure
http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.reference.dijoystate%28v=VS.85%29.aspx
- Code: Select all
typedef struct DIJOYSTATE {
LONG lX;
LONG lY;
LONG lZ;
LONG lRx;
LONG lRy;
LONG lRz;
LONG rglSlider[2];
DWORD rgdwPOV[4];
BYTE rgbButtons[32];
} DIJOYSTATE, *LPDIJOYSTATE;
DIJOYSTATE2 Structure
http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.reference.dijoystate2%28v=VS.85%29.aspx
8 position axis, 8 velocity axis, 8 acceleration axis, 8 force axis all LONGs
DIJOYSTATE2 is like having 4 simultaneous DIJOYSTATE Structures!
(too long to post the structure here!)
I just don't see how Direct Input would be considered legacy? I'd much rather have 65536 levels of input per direction than merely 256 levels of input per direction, and 8 axis.
