コード例 #1
0
        /// <summary>Gets the state.</summary>
        /// <returns>The state of this controller.</returns>
        public State GetState()
        {
            State stateRef;

            ErrorCodeHelper.ToResult(xinput.XInputGetState((int)this.userIndex, out stateRef)).CheckError();
            return(stateRef);
        }
コード例 #2
0
        /// <summary>
        /// Gets the state.
        /// </summary>
        /// <returns>The state of this controller.</returns>
        public State GetState()
        {
            State temp;
            var   result = ErrorCodeHelper.ToResult(xinput.XInputGetState((int)userIndex, out temp));

            result.CheckError();
            return(temp);
        }
コード例 #3
0
ファイル: XInput.cs プロジェクト: yinyue200/Vortice.Windows
 /// <summary>
 /// Retrieves the current state of the specified controller.
 /// </summary>
 /// <param name="userIndex">Index of the user's controller. Can be a value from 0 to 3.</param>
 /// <param name="state">Instance of <see cref="State"/> struct.</param>
 /// <returns>True if success, false if not connected or error.</returns>
 public static bool GetState(int userIndex, out State state)
 {
     return(s_xInput.XInputGetState(userIndex, out state) == 0);
 }