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:

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 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 {
      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...
 
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)
inline

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_get_roles()

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

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

◆ 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(), 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).

◆ 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.

◆ 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.

◆ 

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: