//this function is not available prior to Windows 8 public static int XInputGetBatteryInformation( int dwUserIndex, // Index of the gamer associated with the device byte devType, // Which device on this user index ref XInputBatteryInformation pBatteryInformation // Contains the level and types of batteries ) { return IsWin8OrNewer ? XInput14.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation) : XInput910.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation); }
//this function is not available prior to Windows 8 public static int XInputGetBatteryInformation( int dwUserIndex, // Index of the gamer associated with the device byte devType, // Which device on this user index ref XInputBatteryInformation pBatteryInformation // Contains the level and types of batteries ) { return 0; }
public void UpdateBatteryState() { var gamepad = new XInputBatteryInformation(); _xInput.GetBatteryInformation(_playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_GAMEPAD, ref gamepad); BatteryInformationGamepad = gamepad; }
//this function is not available prior to Windows 8 public static int XInputGetBatteryInformation ( int dwUserIndex, // Index of the gamer associated with the device byte devType, // Which device on this user index ref XInputBatteryInformation pBatteryInformation // Contains the level and types of batteries ) { return(0); }
//this function is not available prior to Windows 8 public static int XInputGetBatteryInformation ( int dwUserIndex, // Index of the gamer associated with the device byte devType, // Which device on this user index ref XInputBatteryInformation pBatteryInformation // Contains the level and types of batteries ) { return(IsWin8OrNewer ? XInput14.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation) : XInput910.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation)); }
public void UpdateBatteryState() { XInputBatteryInformation headset = new XInputBatteryInformation(), gamepad = new XInputBatteryInformation(); XInput.XInputGetBatteryInformation(_playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_GAMEPAD, ref gamepad); XInput.XInputGetBatteryInformation(_playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_HEADSET, ref headset); BatteryInformationHeadset = headset; BatteryInformationGamepad = gamepad; }
public int GetBatteryInformation(int dwUserIndex, byte devType, ref XInputBatteryInformation pBatteryInformation) { switch (dllIndex) { case 0: return XInputGetBatteryInformation14(dwUserIndex, devType, ref pBatteryInformation); case 1: return XInputGetBatteryInformation13(dwUserIndex, devType, ref pBatteryInformation); default: return -1; } }
public static extern int XInputGetBatteryInformation14(int dwUserIndex, byte devType, ref XInputBatteryInformation pBatteryInformation);