C Specification

The XrBatteryStateDisplayEXT structure is defined as:

// Provided by XR_EXT_interaction_profile_battery_state_display
typedef struct XrBatteryStateDisplayEXT {
    XrStructureType                       type;
    void*                                 next;
    XrBatteryStateDisplayStateFlagsEXT    stateFlags;
    float                                 batteryLevel;
} XrBatteryStateDisplayEXT;

Members

Member Descriptions
  • type is the XrStructureType of this structure.

  • next is NULL or a pointer to the next structure in a structure chain.

  • stateFlags describes the validity of batteryLevel with bit masks defined in XrBatteryStateDisplayStateFlagBitsEXT

  • batteryLevel is the level of the battery (from 0.0f to 1.0f) of the device connected by the associated entity or action.

Description

To query the battery level, the application chains an XrBatteryStateDisplayEXT structure to the XrInteractionProfileState::next chain when calling xrGetCurrentInteractionProfile.

If xrGetCurrentInteractionProfile sets the XrInteractionProfileState::interactionProfile to XR_NULL_PATH, then the runtime must not set the XR_BATTERY_STATE_DISPLAY_STATE_VALID_BIT_EXT bit in stateFlags.

XR_BATTERY_STATE_DISPLAY_STATE_VALID_BIT_EXT indicates whether the batteryLevel contains valid data. The application must not read the batteryLevel if the XR_BATTERY_STATE_DISPLAY_STATE_VALID_BIT_EXT bit is not set in stateFlags.

Valid Usage (Implicit)

See Also

Document Notes

For more information, see the OpenXR Specification

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2026 The Khronos Group Inc.