Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
		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);
		}
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 public static extern uint XInputGamePadGetState(
     uint playerIndex,
     out GamePadState.RawState state);
Ejemplo n.º 5
0
 public static uint XInputGamePadGetState(uint playerIndex, out GamePadState.RawState state)
 {
     return(UInputGamePadGetState(playerIndex, out state));
 }