public static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone deadZone) { GamePadState.RawState state = new GamePadState.RawState(); uint result = Imports.XInputGamePadGetState((uint)playerIndex, out state); return(new GamePadState(result == Utils.Success, state, deadZone)); }
public static GamePadState GetState( PlayerIndex playerIndex, GamePadDeadZone deadZone ) { IntPtr gamePadStatePointer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GamePadState.RawState))); uint result = Imports.XInputGamePadGetState((uint)playerIndex, gamePadStatePointer); GamePadState.RawState state = (GamePadState.RawState)Marshal.PtrToStructure(gamePadStatePointer, typeof(GamePadState.RawState)); return new GamePadState(result == Utils.Success, state, deadZone); }
public static GamePadState GetState(PlayerIndex playerIndex) { IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GamePadState.RawState))); uint num = Imports.XInputGamePadGetState((uint)playerIndex, intPtr); GamePadState.RawState rawState = (GamePadState.RawState)Marshal.PtrToStructure(intPtr, typeof(GamePadState.RawState)); return(new GamePadState(num == 0, rawState)); }
public static extern uint XInputGamePadGetState( uint playerIndex, out GamePadState.RawState state);
public static uint XInputGamePadGetState(uint playerIndex, out GamePadState.RawState state) { return(UInputGamePadGetState(playerIndex, out state)); }