GuyInGrey / AptitudeEngine

A 2D based, new technology using, game engine in C#.
https://guyingrey.github.io/
MIT License
0 stars 0 forks source link

Context-Sensitive Gamepad Input #13

Open dresswithpockets opened 7 years ago

dresswithpockets commented 7 years ago

what

Introduce a system for maintaining the state of multiple game pads via RawInput in Input. Append an event in AptContext for whenever this state changes.


why

Currently there are no events in GameWindow for changes in the states for game pads exposed by OpenTK - in fact, the GamePad API is not implemented.


in Input

use the implementation provided by Adrian Cox to implement hooking into a gamepad and managing its state.


GamePadStateChangedEventArgs

An EventArgs representation of a game pad state from Input.


in AptContext

introduce an event in AptContext:

public event EventArgs<GamePadStateChangedEventArgs> GamePadStateChanged;

which is invoked once a frame, before PreUpdate is called, whenever the state of a game pad changes.