示例#1
0
        /// <summary>
        /// <p>Retrieves the battery type and charge status of a wireless controller.</p>
        /// </summary>
        /// <param name="dwUserIndex"><dd> <p>Index of the signed-in gamer associated with the device. Can be a value in the range 0?XUSER_MAX_COUNT ? 1.</p> </dd></param>
        /// <param name="devType"><dd> <p>Specifies which device associated with this user index should be queried. Must be <see cref="SharpDX.XInput.BatteryDeviceType.Gamepad"/> or <see cref="SharpDX.XInput.BatteryDeviceType.Headset"/>.</p> </dd></param>
        /// <param name="batteryInformationRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.XInput.BatteryInformation"/></strong> structure that receives the battery information.</p> </dd></param>
        /// <returns><p>If the function succeeds, the return value is <see cref="SharpDX.Win32.ErrorCode.Success"/>.</p></returns>
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='XInputGetBatteryInformation']/*"/>
        /// <msdn-id>microsoft.directx_sdk.reference.xinputgetbatteryinformation</msdn-id>
        /// <unmanaged>unsigned int XInputGetBatteryInformation([In] unsigned int dwUserIndex,[In] BATTERY_DEVTYPE devType,[Out] XINPUT_BATTERY_INFORMATION* pBatteryInformation)</unmanaged>
        /// <unmanaged-short>XInputGetBatteryInformation</unmanaged-short>
        public static int XInputGetBatteryInformation(int dwUserIndex, SharpDX.XInput.BatteryDeviceType devType, out SharpDX.XInput.BatteryInformation batteryInformationRef)
        {
            unsafe {
                batteryInformationRef = new SharpDX.XInput.BatteryInformation();
                int __result__;

                fixed(void *batteryInformationRef_ = &batteryInformationRef)
                __result__ =
                    XInputGetBatteryInformation_(dwUserIndex, unchecked ((int)devType), batteryInformationRef_);

                return(__result__);
            }
        }
示例#2
0
        /// <summary>
        /// <p>Retrieves the battery type and charge status of a wireless controller.</p>
        /// </summary>
        /// <param name = "dwUserIndex"><dd> <p>Index of the signed-in gamer associated with the device. Can be a value in the range 0?XUSER_MAX_COUNT ? 1.</p> </dd></param>
        /// <param name = "devType"><dd> <p>Specifies which device associated with this user index should be queried. Must be <strong>BATTERY_DEVTYPE_GAMEPAD</strong> or <strong>BATTERY_DEVTYPE_HEADSET</strong>.</p> </dd></param>
        /// <param name = "batteryInformationRef"><dd> <p>Pointer to an <strong><see cref = "SharpDX.XInput.BatteryInformation"/></strong> structure that receives the battery information.</p> </dd></param>
        /// <returns><p>If the function succeeds, the return value is <strong>ERROR_SUCCESS</strong>.</p></returns>
        /// <doc-id>microsoft.directx_sdk.reference.xinputgetbatteryinformation</doc-id>
        /// <unmanaged>DWORD XInputGetBatteryInformation([In] DWORD dwUserIndex,[In] unsigned char devType,[Out] XINPUT_BATTERY_INFORMATION* pBatteryInformation)</unmanaged>
        /// <unmanaged-short>XInputGetBatteryInformation</unmanaged-short>
        public static unsafe System.Int32 XInputGetBatteryInformation(System.Int32 dwUserIndex, SharpDX.XInput.BatteryDeviceType devType, out SharpDX.XInput.BatteryInformation batteryInformationRef)
        {
            batteryInformationRef = default(SharpDX.XInput.BatteryInformation);
            System.Int32 __result__;

            fixed(void *batteryInformationRef_ = &batteryInformationRef)
            __result__ = XInputGetBatteryInformation_(dwUserIndex, unchecked ((System.Int32)devType), batteryInformationRef_);

            return(__result__);
        }