public static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone deadZone) { GamePadState.RawState state; 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 GamePadState GetState(PlayerIndex playerIndex) { var gamePadStatePointer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GamePadState.RawState))); var result = Imports.XInputGamePadGetState((uint)playerIndex, gamePadStatePointer); var state = (GamePadState.RawState)Marshal.PtrToStructure(gamePadStatePointer, typeof(GamePadState.RawState)); return(new GamePadState(result == 0, state)); }
public static GamePadState GetState(PlayerIndex playerIndex, GamePadDeadZone deadZone) { InitDistanceLoader(); return(new GamePadState(Imports.XInputGamePadGetState((uint)playerIndex, out var state) == 0U, state, deadZone)); }