Monado OpenXR Runtime
xrt_system_roles Struct Reference

Data associating a device index (in xrt_system_devices::xdevs) with a given "role" for dynamic role switching. More...

#include <xrt/xrt_system.h>

Collaboration diagram for xrt_system_roles:

Data Fields

uint64_t generation_id
 Monotonically increasing generation counter for the association between role and index. More...
 
int32_t left
 Index in xrt_system_devices::xdevs for the user's left controller/hand, or negative if none available. More...
 
int32_t right
 Index in xrt_system_devices::xdevs for the user's right controller/hand, or negative if none available. More...
 
int32_t gamepad
 Index in xrt_system_devices::xdevs for the user's gamepad device, or negative if none available. More...
 
enum xrt_device_name left_profile
 
enum xrt_device_name right_profile
 
enum xrt_device_name gamepad_profile
 

Related Functions

(Note that these are not member functions.)

#define XRT_SYSTEM_ROLES_INIT
 Guaranteed invalid constant for xrt_system_roles, not using designated initializers due to C++. More...
 

Detailed Description

Data associating a device index (in xrt_system_devices::xdevs) with a given "role" for dynamic role switching.

For each of the named roles, a negative value means unpopulated/not available.

Populated by a call from the xrt_system_devices interface.

When the caller of xrt_system_devices_get_roles sees a change (based on comparing generation_id) the caller must do the needed actions to handle device changes. For example, for the OpenXR state tracker this may include rebinding, queuing a change to the current interaction profile, and queuing the events associated with such a change.

See also
xrt_system_devices

Friends And Related Function Documentation

◆ XRT_SYSTEM_ROLES_INIT

#define XRT_SYSTEM_ROLES_INIT
related
Value:
{ \
0, -1, -1, -1, XRT_DEVICE_INVALID, XRT_DEVICE_INVALID, XRT_DEVICE_INVALID, \
}

Guaranteed invalid constant for xrt_system_roles, not using designated initializers due to C++.

Referenced by oxr_system_fill_in().

Field Documentation

◆ gamepad

int32_t xrt_system_roles::gamepad

Index in xrt_system_devices::xdevs for the user's gamepad device, or negative if none available.

◆ generation_id

uint64_t xrt_system_roles::generation_id

Monotonically increasing generation counter for the association between role and index.

Increment whenever the roles are changed.

All valid values are greater then zero; this is to make init easier where any cache can start at zero and be guaranteed to be replaced with a new xrt_system_roles.

◆ left

int32_t xrt_system_roles::left

Index in xrt_system_devices::xdevs for the user's left controller/hand, or negative if none available.

◆ right

int32_t xrt_system_roles::right

Index in xrt_system_devices::xdevs for the user's right controller/hand, or negative if none available.


The documentation for this struct was generated from the following file: