A simple XInput wrapper libraryBy Rim van Wersch, August 25 2006 |
??????????
This utility library allows you to work with controllers that support XInput from MDX/.NET 1.1. The library provides a simple wrapper around the functions exposed by the XInput library, allowing you to easily fetch the state information from the controller and set the speeds of the rumble motors.
The utility library comes with a demo application which shows how to work with the library. By request we've also implemented our event model to fire events whenever the state of the controller changes. The event model can be turned on and off for efficiency in the extended wrapper, but if you already have a (game) update loop in your application, the original wrapper may be a bit cleaner to work with.
Below are the files for working with the wrapper. You'll ONLY need to download and run the XInput redistributable if you don't already have the recent update of the DirectX SDK installed. The wrapper and the demo app of the original wrapper are provided in the same VS2003 solution, but you can just use the wrapper lib and project in any other project you like. The extended wrapper is provided in a VS2005 solution, with a seperate (less flashy) test project.
Known limitations: since we didn't have a headset for the controller, we were unable to test the audio input/output functionality of the controller, so that functionality didn't make it into the wrapper. The wrapper also doesn't bother to do any capabilities check on the controller, assuming standard XBox360 gamepad functionality.
Files for this resource
Filename | Size |
? Original XInput wrapper with demo application | 38.8 KB |
? Extended wrapper which generates XInput events | 27.0 KB |
? XInput redistributable Dec 2005 | 427.9 KB |