36#define XRT_SYSTEM_ID 1
38#define XRT_MAX_SYSTEM_NAME_SIZE 256
46 char name[XRT_MAX_SYSTEM_NAME_SIZE];
117XRT_NONNULL_ALL
static inline void
201#define XRT_SYSTEM_ROLES_INIT \
203 0, -1, -1, -1, XRT_DEVICE_INVALID, XRT_DEVICE_INVALID, XRT_DEVICE_INVALID, \
362 return xsysd->
get_roles(xsysd, out_roles);
401XRT_NONNULL_ALL
static inline void
#define XRT_SYSTEM_MAX_DEVICES
Maximum number of devices simultaneously usable by an implementation of xrt_system_devices.
Definition xrt_limits.h:26
xrt_form_factor
What form factor is this device, mostly maps onto OpenXR's XrFormFactor.
Definition xrt_defines.h:2398
enum xrt_result xrt_result_t
Result type used across Monado.
Main compositor server interface.
Definition xrt_compositor.h:2260
A single HMD or input device.
Definition xrt_device.h:310
This interface acts as a root object for Monado.
Definition xrt_instance.h:120
Session information, mostly overlay extension data.
Definition xrt_compositor.h:949
The XRT representation of XrSession, this object does not have all of the functionality of a session,...
Definition xrt_session.h:277
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition xrt_system.h:214
xrt_result_t(* feature_inc)(struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)
Increment the usage count of a feature.
Definition xrt_system.h:331
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 mor...
Definition xrt_system.h:322
static XRT_NONNULL_ALL void xrt_system_devices_destroy(struct xrt_system_devices **xsysd_ptr)
Destroy an xrt_system_devices and owned devices - helper function.
Definition xrt_system.h:402
void(* destroy)(struct xrt_system_devices *xsysd)
Destroy all the devices that are owned by this system devices.
Definition xrt_system.h:349
size_t static_xdev_count
The number of elements in static_xdevs that are valid in the static device list.
Definition xrt_system.h:227
struct xrt_device * head
An observing pointer to the device serving as the "head" (and HMD).
Definition xrt_system.h:244
struct xrt_device * face
An observing pointer to the device providing face tracking (optional).
Definition xrt_system.h:256
struct xrt_device * eyes
An observing pointer to the device providing eye tracking (optional).
Definition xrt_system.h:250
static XRT_NONNULL_ALL 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.
Definition xrt_system.h:386
xrt_result_t(* feature_dec)(struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)
Decrement the usage count of a feature.
Definition xrt_system.h:340
struct xrt_device * left
An observing pointer to the device providing unobstructed hand-tracking for the left hand (optional).
Definition xrt_system.h:279
static XRT_NONNULL_ALL 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 mor...
Definition xrt_system.h:360
struct xrt_device * right
An observing pointer to the device providing unobstructed hand-tracking for the right hand (optional)...
Definition xrt_system.h:288
struct xrt_device * body
An observing pointer to the device providing body tracking (optional).
Definition xrt_system.h:262
static XRT_NONNULL_ALL 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.
Definition xrt_system.h:373
Properties provided by the system.
Definition xrt_system.h:44
Data associating a device index (in xrt_system_devices::static_xdevs) with a given "role" for dynamic...
Definition xrt_system.h:154
int32_t right
Index in xrt_system_devices::static_xdevs for the user's right controller/hand, or negative if none a...
Definition xrt_system.h:179
XRT_ALIGNAS(8) uint64_t generation_id
Monotonically increasing generation counter for the association between role and index.
int32_t gamepad
Index in xrt_system_devices::static_xdevs for the user's gamepad device, or negative if none availabl...
Definition xrt_system.h:185
int32_t left
Index in xrt_system_devices::static_xdevs for the user's left controller/hand, or negative if none av...
Definition xrt_system.h:173
A system is a collection of devices, policies and optionally a compositor that is organised into a ch...
Definition xrt_system.h:63
xrt_result_t(* create_session)(struct xrt_system *xsys, const struct xrt_session_info *xsi, struct xrt_session **out_xs, struct xrt_compositor_native **out_xcn)
Create a xrt_session and optionally a xrt_compositor_native for this system.
Definition xrt_system.h:73
static XRT_NONNULL_ALL void xrt_system_destroy(struct xrt_system **xsys_ptr)
Destroy an xrt_system - helper function.
Definition xrt_system.h:118
static xrt_result_t xrt_system_create_session(struct xrt_system *xsys, const struct xrt_session_info *xsi, struct xrt_session **out_xs, struct xrt_compositor_native **out_xcn)
Create a xrt_session and optionally a xrt_compositor_native for this system.
Definition xrt_system.h:99
void(* destroy)(struct xrt_system *xsys)
Destroy the system, must be destroyed after system devices and system compositor has been destroyed.
Definition xrt_system.h:86
Header holding common defines.
Common defines and enums for XRT.
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition xrt_defines.h:737
Header defining an xrt display or controller device.
xrt_device_feature_type
Higher level features for devices.
Definition xrt_device.h:254
Header for limits of the XRT interfaces.