/// <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);
        }
        /// <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);
        }
Exemple #3
0
 /// <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);
 }