Engine Feature Proposal
I am planning on implementing XInput in the engine, so that the engine can support Xbox controllers. It will have the following features
- Able to check when a button is pressed.
- Get the amount of deflection of triggers and sticks.
- Built in support for dead zones.
- Support for haptic vibration. Every xbox 360 controller contains 2 vibration motors. Support to set vibration levels for each individual motor.
This information is provided through functions. There will be an enumeration of all the button present on the controller. Functions which poll for a specific button or trigger require the game to send the enum value as a function parameter. There will be no need to create data files in the first iteration of the feature (See stretch goals).
I am planning on creating an platform independent interface which exposes all these functionalities as functions. Since XInput is windows specific API, the windows specific code will be hidden behind platform independent functions which will be public. There will not be any data that will be written to files and then read from them for the first version of implementation. So the user will have a set of functions that they can call to get the data from the library.
- Support for multiple controllers. XInput API supports upto four controllers.
- Support for button remapping using Lua/Binary files
- Support for pub-sub for events, where instead of the game polling for button presses, the engine will raise an event and call a specific function when the button is pressed.