Esempio n. 1
0
        /// <summary>
        /// Updates the BatteryState.
        /// </summary>
        internal void UpdateBatteryState()
        {
            XInputBatteryInformation headset = new XInputBatteryInformation(),
                                     gamepad = new XInputBatteryInformation();

            XInputInterops.XInputGetBatteryInformation(_playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_GAMEPAD,
                                                       ref gamepad);
            XInputInterops.XInputGetBatteryInformation(_playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_HEADSET,
                                                       ref headset);

            BatteryInformationHeadset = headset;
            BatteryInformationGamepad = gamepad;
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the BatteryState.
        /// </summary>
        internal void UpdateBatteryState()
        {
            XInputBatteryInformation headset = new XInputBatteryInformation(),
                gamepad = new XInputBatteryInformation();

            XInputInterops.XInputGetBatteryInformation(_playerIndex, (byte) BatteryDeviceType.BATTERY_DEVTYPE_GAMEPAD,
                ref gamepad);
            XInputInterops.XInputGetBatteryInformation(_playerIndex, (byte) BatteryDeviceType.BATTERY_DEVTYPE_HEADSET,
                ref headset);

            BatteryInformationHeadset = headset;
            BatteryInformationGamepad = gamepad;
        }