Monado OpenXR Runtime
xrt_system_devices Struct Reference

A collection of xrt_device, and an interface for identifying the roles they have been assigned. More...

#include <xrt/xrt_system.h>

Inheritance diagram for xrt_system_devices:
Collaboration diagram for xrt_system_devices:

Static Public Member Functions

static xrt_result_t xrt_system_devices_get_roles (struct xrt_system_devices *xsysd, struct xrt_system_roles *out_roles)
 Function to get the dynamic input device roles from this system devices, see xrt_system_roles for more information. More...
 
static xrt_result_t xrt_system_devices_feature_inc (struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)
 Increment the usage count of a feature. More...
 
static xrt_result_t xrt_system_devices_feature_dec (struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)
 Decrement the usage count of a feature. More...
 
static void xrt_system_devices_destroy (struct xrt_system_devices **xsysd_ptr)
 Destroy an xrt_system_devices and owned devices - helper function. More...
 

Data Fields

struct xrt_devicexdevs [(32)]
 All devices known in the system. More...
 
size_t xdev_count
 The number of elements in xdevs that are valid. More...
 
struct {
   struct xrt_device *   head
 An observing pointer to the device serving as the "head" (and HMD). More...
 
   struct xrt_device *   eyes
 An observing pointer to the device providing eye tracking (optional). More...
 
   struct xrt_device *   face
 An observing pointer to the device providing face tracking (optional). More...
 
   struct xrt_device *   body
 An observing pointer to the device providing body tracking (optional). More...
 
   struct {
      struct xrt_device *   left
 An observing pointer to the device providing hand tracking for the left hand (optional). More...
 
      struct xrt_device *   right
 An observing pointer to the device providing hand tracking for the right hand (optional). More...
 
   }   hand_tracking
 Devices providing optical (or otherwise more directly measured than from controller estimation) hand tracking. More...
 
static_roles
 Observing pointers for devices in some static (unchangeable) roles. More...
 
xrt_result_t(* get_roles )(struct xrt_system_devices *xsysd, struct xrt_system_roles *out_roles)
 Function to get the dynamic input device roles from this system devices, see xrt_system_roles for more information. More...
 
xrt_result_t(* feature_inc )(struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)
 Increment the usage count of a feature. More...
 
xrt_result_t(* feature_dec )(struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)
 Decrement the usage count of a feature. More...
 
void(* destroy )(struct xrt_system_devices *xsysd)
 Destroy all the devices that are owned by this system devices. More...
 

Detailed Description

A collection of xrt_device, and an interface for identifying the roles they have been assigned.

See also
xrt_device, xrt_instance.

Member Function Documentation

◆ xrt_system_devices_destroy()

static void xrt_system_devices_destroy ( struct xrt_system_devices **  xsysd_ptr)
inlinestatic

Destroy an xrt_system_devices and owned devices - helper function.

Parameters
[in,out]xsysd_ptrA pointer to the xrt_system_devices struct pointer.

Will destroy the system devices if *xsysd_ptr is not NULL. Will then set *xsysd_ptr to NULL.

References destroy.

Referenced by u_builder_roles_helper_open_system().

◆ xrt_system_devices_feature_dec()

static xrt_result_t xrt_system_devices_feature_dec ( struct xrt_system_devices xsysd,
enum xrt_device_feature_type  type 
)
inlinestatic

Decrement the usage count of a feature.

When the feature is not used by the current application any more, then the feature will be ended.

Parameters
xsysdPointer to self
featureWhich feature is being counted.

Helper for calling through the function pointer.

◆ xrt_system_devices_feature_inc()

static xrt_result_t xrt_system_devices_feature_inc ( struct xrt_system_devices xsysd,
enum xrt_device_feature_type  type 
)
inlinestatic

Increment the usage count of a feature.

When the feature is used for the first time, then the feature will be begun.

Parameters
xsysdPointer to self
featureWhich feature is being counted.

Helper for calling through the function pointer.

◆ xrt_system_devices_get_roles()

static xrt_result_t xrt_system_devices_get_roles ( struct xrt_system_devices xsysd,
struct xrt_system_roles out_roles 
)
inlinestatic

Function to get the dynamic input device roles from this system devices, see xrt_system_roles for more information.

Parameters
xsysdPointer to self
[out]out_rolesPointer to xrt_system_roles

Helper for calling through the function pointer.

References get_roles.

Field Documentation

◆ body

struct xrt_device* xrt_system_devices::body

An observing pointer to the device providing body tracking (optional).

◆ destroy

void(* xrt_system_devices::destroy) (struct xrt_system_devices *xsysd)

Destroy all the devices that are owned by this system devices.

Code consuming this interface should use xrt_system_devices_destroy.

Parameters
xsysdPointer to self

Referenced by r_create_devices(), sdl_system_devices_init(), steamvr_lh_create_devices(), u_system_devices_allocate(), u_system_devices_static_allocate(), and xrt_system_devices_destroy().

◆ eyes

struct xrt_device* xrt_system_devices::eyes

An observing pointer to the device providing eye tracking (optional).

◆ face

struct xrt_device* xrt_system_devices::face

An observing pointer to the device providing face tracking (optional).

◆ feature_dec

xrt_result_t(* xrt_system_devices::feature_dec) (struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)

Decrement the usage count of a feature.

When the feature is not used by the current application any more, then the feature will be ended.

Parameters
xsysdPointer to self
featureWhich feature is being counted.

◆ feature_inc

xrt_result_t(* xrt_system_devices::feature_inc) (struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)

Increment the usage count of a feature.

When the feature is used for the first time, then the feature will be begun.

Parameters
xsysdPointer to self
featureWhich feature is being counted.

◆ get_roles

xrt_result_t(* xrt_system_devices::get_roles) (struct xrt_system_devices *xsysd, struct xrt_system_roles *out_roles)

Function to get the dynamic input device roles from this system devices, see xrt_system_roles for more information.

Parameters
xsysdPointer to self
[out]out_rolesPointer to xrt_system_roles

Referenced by xrt_system_devices_get_roles().

◆ 

struct { ... } xrt_system_devices::hand_tracking

Devices providing optical (or otherwise more directly measured than from controller estimation) hand tracking.

Referenced by u_builder_roles_helper_open_system().

◆ head

struct xrt_device* xrt_system_devices::head

An observing pointer to the device serving as the "head" (and HMD).

Required.

Referenced by u_builder_roles_helper_open_system().

◆ left

struct xrt_device* xrt_system_devices::left

An observing pointer to the device providing hand tracking for the left hand (optional).

Currently this is used for both optical and controller driven hand-tracking.

Referenced by u_builder_roles_helper_open_system().

◆ right

struct xrt_device* xrt_system_devices::right

An observing pointer to the device providing hand tracking for the right hand (optional).

Currently this is used for both optical and controller driven hand-tracking.

Referenced by u_builder_roles_helper_open_system().

◆ 

struct { ... } xrt_system_devices::static_roles

Observing pointers for devices in some static (unchangeable) roles.

All pointers in this struct must also exist in xdevs. The association between a member of this struct and a given device cannot change during runtime.

Referenced by u_builder_roles_helper_open_system().

◆ xdev_count

size_t xrt_system_devices::xdev_count

The number of elements in xdevs that are valid.

Referenced by u_builder_roles_helper_open_system(), and u_system_devices_get_ht_device().

◆ xdevs

struct xrt_device* xrt_system_devices::xdevs[(32)]

All devices known in the system.

This is conventionally considered the "owning" reference to the devices. Valid entries are contiguous.

Referenced by u_builder_roles_helper_open_system(), u_system_devices_close(), and u_system_devices_get_ht_device().


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