internal void __MarshalFrom(ref Capabilities.__Native @ref)
 {
     this.Type    = @ref.Type;
     this.SubType = @ref.SubType;
     this.Flags   = @ref.Flags;
     this.Gamepad = @ref.Gamepad;
     this.Vibration.__MarshalFrom(ref @ref.Vibration);
 }
 internal void __MarshalTo(ref Capabilities.__Native @ref)
 {
     @ref.Type    = this.Type;
     @ref.SubType = this.SubType;
     @ref.Flags   = this.Flags;
     @ref.Gamepad = this.Gamepad;
     this.Vibration.__MarshalTo(ref @ref.Vibration);
 }
Exemplo n.º 3
0
        /// <summary>
        /// <p>Retrieves the capabilities and features of a connected controller.</p>
        /// </summary>
        /// <param name="dwUserIndex"><dd> <p>Index of the user's controller. Can be a value in the range 0?3. For information about how this value is determined and how the value maps to indicators on the controller, see Multiple Controllers. </p> </dd></param>
        /// <param name="dwFlags"><dd> <p>Input flags that identify the controller type. If this value is 0, then the capabilities of all controllers connected to the system are returned. Currently, only one value is supported:</p> <table> <tr><th>Value</th><th>Description</th></tr> <tr><td><strong>XINPUT_FLAG_GAMEPAD</strong></td><td>Limit query to devices of Xbox 360 Controller type.</td></tr> </table> <p>?</p> <p>Any value of <em>dwflags</em> other than the above or 0 is illegal and will result in an error break when debugging.</p> </dd></param>
        /// <param name="capabilitiesRef"><dd> <p>Pointer to an <strong><see cref="T:SharpDX.XInput.Capabilities" /></strong> structure that receives the controller capabilities.</p> </dd></param>
        /// <returns><p>If the function succeeds, the return value is <strong>ERROR_SUCCESS</strong>.</p><p>If the controller is not connected, the return value is <strong>ERROR_DEVICE_NOT_CONNECTED</strong>.</p><p>If the function fails, the return value is an error code defined in WinError.h. The function does not use <em>SetLastError</em> to set the calling thread's last-error code.</p></returns>
        /// <remarks>
        /// <strong>Note</strong>??The legacy XINPUT 9.1.0 version (included in Windows?Vista and later) always returned a fixed set of capabilities regardless of attached device.?
        /// </remarks>
        /// <doc-id>microsoft.directx_sdk.reference.xinputgetcapabilities</doc-id>
        /// <unmanaged>DWORD XInputGetCapabilities([In] DWORD dwUserIndex,[In] DWORD dwFlags,[Out] XINPUT_CAPABILITIES* pCapabilities)</unmanaged>
        /// <unmanaged-short>XInputGetCapabilities</unmanaged-short>
        public static unsafe int XInputGetCapabilities(
            int dwUserIndex,
            DeviceQueryType dwFlags,
            out Capabilities capabilitiesRef)
        {
            Capabilities.__Native @ref = new Capabilities.__Native();
            capabilitiesRef = new Capabilities();
            int capabilities = XInputGetCapabilities_(dwUserIndex, (int)dwFlags, (void *)&@ref);

            capabilitiesRef.__MarshalFrom(ref @ref);
            return(capabilities);
        }
 internal void __MarshalFree(ref Capabilities.__Native @ref)
 {
     this.Vibration.__MarshalFree(ref @ref.Vibration);
 }