public void Update() { prev_state = curr_state; if (XInput.XInputGetState(index, ref curr_state) != 0x0) //0x0 is ERROR_SUCCESS { curr_state.Gamepad.Zero(); } }
public static extern int XInputGetState(int ControllerIndex, ref XInputState State);
public XboxController(int Index) { index = Index; curr_state = new XInputState(); prev_state = new XInputState(); }