WVR_EXPORT float WVR_GetDeviceBatteryPercentage(WVR_DeviceType type)
Get the remaining battery power in percentage, of specified device.
- The percentage of the remaining battery power of the specified device.
- API Level 1
type: Device type to get the InputDeviceState. (refer to WVR_DeviceType)
How to use¶
Here is an example for the function:
#include <wvr/wvr_device.h> // Get HMD remaining battery power in Percentage float Percentage = 0.0; Percentage = WVR_GetDeviceBatteryPercentage(WVR_DeviceType_HMD);
The WVR_GetDeviceBatteryPercentage will return a value from 0 to 1. If the current battery power is at 22%, the returned value will be 0.22.