Monado OpenXR Runtime
xrt_device.h
Go to the documentation of this file.
1// Copyright 2019-2024, Collabora, Ltd.
2// Copyright 2024-2025, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Header defining an xrt display or controller device.
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @author Moshi Turner <moshiturner@protonmail.com>
9 * @author Korcan Hussein <korcan.hussein@collabora.com>
10 * @ingroup xrt_iface
11 */
12
13#pragma once
14
15#include "xrt/xrt_defines.h"
18#include "xrt/xrt_limits.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24struct xrt_tracking;
25
26#define XRT_DEVICE_NAME_LEN 256
27
28
29/*!
30 * A per-lens/display view information.
31 *
32 * @ingroup xrt_iface
33 */
35{
36 /*!
37 * @brief Viewport position on the screen.
38 *
39 * In absolute screen coordinates on an unrotated display, like the
40 * HMD presents it to the OS.
41 *
42 * This field is only used by @ref comp to setup the device rendering.
43 *
44 * If the view is being rotated by xrt_view.rot 90° right in the
45 * distortion shader then `display.w_pixels == viewport.h_pixels` and
46 * `display.h_pixels == viewport.w_pixels`.
47 */
48 struct
49 {
50 uint32_t x_pixels;
51 uint32_t y_pixels;
52 uint32_t w_pixels;
53 uint32_t h_pixels;
55
56 /*!
57 * @brief Physical properties of this display (or the part of a display
58 * that covers this view).
59 *
60 * Not in absolute screen coordinates but like the clients see them i.e.
61 * after rotation is applied by xrt_view::rot.
62 * This field is only used for the clients' swapchain setup.
63 *
64 * The xrt_view::display::w_pixels and xrt_view::display::h_pixels
65 * become the recommended image size for this view, after being scaled
66 * by the debug environment variable `XRT_COMPOSITOR_SCALE_PERCENTAGE`.
67 */
68 struct
69 {
70 uint32_t w_pixels;
71 uint32_t h_pixels;
73
74 /*!
75 * @brief Rotation 2d matrix used to rotate the position of the output
76 * of the distortion shaders onto the screen.
77 *
78 * If the distortion shader is based on a mesh, then this matrix rotates
79 * the vertex positions.
80 */
82};
83
84/*!
85 * All of the device components that deals with interfacing to a users head.
86 *
87 * HMD is probably a bad name for the future but for now will have to do.
88 *
89 * @ingroup xrt_iface
90 */
92{
93 /*!
94 * @brief The hmd screen as an unrotated display, like the HMD presents
95 * it to the OS.
96 *
97 * This field is used by @ref comp to setup the extended mode window.
98 */
99 struct
100 {
101 int w_pixels;
102 int h_pixels;
103 //! Nominal frame interval
105 enum xrt_scanout_direction scanout_direction;
106 int64_t scanout_time_ns;
108
109 /*!
110 * Display information.
111 *
112 * For now hardcoded display to two.
113 */
114 struct xrt_view views[XRT_MAX_VIEWS];
115
116 size_t view_count;
117 /*!
118 * Array of supported blend modes.
119 */
120 enum xrt_blend_mode blend_modes[XRT_MAX_DEVICE_BLEND_MODES];
121 size_t blend_mode_count;
122
123 /*!
124 * Distortion information.
125 */
126 struct
127 {
128 //! Supported distortion models, a bitfield.
130 //! Preferred disortion model, single value.
132
133 struct
134 {
135 //! Data.
136 float *vertices;
137 //! Number of vertices.
138 uint32_t vertex_count;
139 //! Stride of vertices
140 uint32_t stride;
141 //! 1 or 3 for (chromatic aberration).
143
144 //! Indices, for triangle strip.
146 //! Number of indices for the triangle strips (one per view).
147 uint32_t index_counts[XRT_MAX_VIEWS];
148 //! Offsets for the indices (one offset per view).
149 uint32_t index_offsets[XRT_MAX_VIEWS];
150 //! Total number of elements in mesh::indices array.
152 } mesh;
153
154 //! distortion is subject to the field of view
155 struct xrt_fov fov[XRT_MAX_VIEWS];
157};
158
159/*!
160 * A single named input, that sits on a @ref xrt_device.
161 *
162 * @ingroup xrt_iface
163 */
165{
166 //! Is this input active.
167 bool active;
168
169 //! alignas for 32 bit client support, see @ref ipc-design
170 XRT_ALIGNAS(8) int64_t timestamp;
171
172 enum xrt_input_name name;
173
174 union xrt_input_value value;
175};
176
177/*!
178 * A single named output, that sits on a @ref xrt_device.
179 *
180 * @ingroup xrt_iface
181 */
183{
184 enum xrt_output_name name;
185};
186
187
188/*!
189 * A binding pair, going @p from a binding point to a @p device input.
190 *
191 * @ingroup xrt_iface
192 */
194{
195 enum xrt_input_name from; //!< From which name.
196 enum xrt_input_name device; //!< To input on the device.
197};
198
199/*!
200 * A binding pair, going @p from a binding point to a @p device output.
201 *
202 * @ingroup xrt_iface
203 */
205{
206 enum xrt_output_name from; //!< From which name.
207 enum xrt_output_name device; //!< To output on the device.
208};
209
210/*!
211 * A binding profile, has lists of binding pairs to goes from device in @p name
212 * to the device it hangs off on.
213 *
214 * @ingroup xrt_iface
215 */
217{
218 //! Device this binding emulates.
220
221 struct xrt_binding_input_pair *inputs;
222 size_t input_count;
223 struct xrt_binding_output_pair *outputs;
224 size_t output_count;
225};
226
227/*!
228 * Higher level features for devices.
229 */
231{
232 XRT_DEVICE_FEATURE_HAND_TRACKING_LEFT = 0,
233 XRT_DEVICE_FEATURE_HAND_TRACKING_RIGHT,
234 XRT_DEVICE_FEATURE_EYE_TRACKING,
235 XRT_DEVICE_FEATURE_MAX_ENUM,
236};
237
238/*!
239 * Output limits of a particular device
240 */
242{
243 //! The sample rate of the device's haptic PCM support, 0 if haptic PCM is not supported.
245};
246
247/*!
248 * Static data of supported features of the @ref xrt_device this struct sits on.
249 *
250 * This struct needs to always be a piece of data as it sits inside of the
251 * shared memory area in the IPC layer, so no pointers please.
252 *
253 * @ingroup xrt_iface
254 */
256{
257 bool orientation_tracking;
258 bool position_tracking;
259 bool hand_tracking;
260 bool eye_gaze;
261 bool presence;
262 bool force_feedback;
263 bool ref_space_usage;
264 bool form_factor_check;
265 bool stage;
266 bool face_tracking;
267 bool body_tracking;
268 bool body_tracking_calibration;
269 bool battery_status;
270 bool brightness_control;
271
272 bool planes;
273 enum xrt_plane_detection_capability_flags_ext plane_capability_flags;
274};
275
276/*!
277 * @interface xrt_device
278 *
279 * A single HMD or input device.
280 *
281 * @ingroup xrt_iface
282 */
284{
285 //! Enum identifier of the device.
287 enum xrt_device_type device_type;
288
289 //! A string describing the device.
290 char str[XRT_DEVICE_NAME_LEN];
291
292 //! A unique identifier. Persistent across configurations, if possible.
293 char serial[XRT_DEVICE_NAME_LEN];
294
295 //! Null if this device does not interface with the users head.
297
298 //! Always set, pointing to the tracking system for this device.
300
301 //! Number of bindings in xrt_device::binding_profiles
303 // Array of alternative binding profiles.
304 struct xrt_binding_profile *binding_profiles;
305
306 //! Number of inputs.
308 //! Array of input structs.
310
311 //! Number of outputs.
313 //! Array of output structs.
315
316 //! What features/functions/things does this device supports?
317 struct xrt_device_supported supported;
318
319
320 /*
321 *
322 * Functions.
323 *
324 */
325
326 /*!
327 * Update any attached inputs.
328 *
329 * @param[in] xdev The device.
330 */
331 xrt_result_t (*update_inputs)(struct xrt_device *xdev);
332
333 /*!
334 * @brief Get relationship of a tracked device to the tracking origin
335 * space as the base space.
336 *
337 * It is the responsibility of the device driver to do any prediction,
338 * there are helper functions available for this.
339 *
340 * The timestamps are system monotonic timestamps, such as returned by
341 * os_monotonic_get_ns().
342 *
343 * @param[in] xdev The device.
344 * @param[in] name Some devices may have multiple poses on
345 * them, select the one using this field. For
346 * HMDs use @p XRT_INPUT_GENERIC_HEAD_POSE.
347 * For Unbounded Reference Space you can use
348 * @p XRT_INPUT_GENERIC_UNBOUNDED_SPACE_POSE
349 * to get the origin of that space.
350 * @param[in] at_timestamp_ns If the device can predict or has a history
351 * of positions, this is when the caller
352 * wants the pose to be from.
353 * @param[out] out_relation The relation read from the device.
354 *
355 * @see xrt_input_name
356 */
358 enum xrt_input_name name,
359 int64_t at_timestamp_ns,
360 struct xrt_space_relation *out_relation);
361
362 /*!
363 * @brief Get relationship of hand joints to the tracking origin space as
364 * the base space.
365 *
366 * It is the responsibility of the device driver to either do prediction
367 * or return joints from a previous time and write that time out to
368 * @p out_timestamp_ns.
369 *
370 * The timestamps are system monotonic timestamps, such as returned by
371 * os_monotonic_get_ns().
372 *
373 * @param[in] xdev The device.
374 * @param[in] name Some devices may have multiple poses on
375 * them, select the one using this field. For
376 * hand tracking use @p XRT_INPUT_GENERIC_HAND_TRACKING_DEFAULT_SET.
377 * @param[in] desired_timestamp_ns If the device can predict or has a history
378 * of positions, this is when the caller
379 * wants the pose to be from.
380 * @param[out] out_value The hand joint data read from the device.
381 * @param[out] out_timestamp_ns The timestamp of the data being returned.
382 *
383 * @see xrt_input_name
384 */
385 xrt_result_t (*get_hand_tracking)(struct xrt_device *xdev,
386 enum xrt_input_name name,
387 int64_t desired_timestamp_ns,
388 struct xrt_hand_joint_set *out_value,
389 int64_t *out_timestamp_ns);
390
391 /*!
392 * @brief Get the requested blend shape properties & weights for a face tracker
393 *
394 * @param[in] xdev The device.
395 * @param[in] facial_expression_type The facial expression data type (XR_FB_face_tracking,
396 * XR_HTC_facial_tracking, etc).
397 * @param[in] at_timestamp_ns Timestamp to be optionally used for prediction/history. For OXR extensions
398 * that do not pass a timestamp, the current timestamp is used.
399 * @param[in] out_value Set of requested expression weights & blend shape properties.
400 *
401 * @see xrt_input_name
402 */
403 xrt_result_t (*get_face_tracking)(struct xrt_device *xdev,
404 enum xrt_input_name facial_expression_type,
405 int64_t at_timestamp_ns,
406 struct xrt_facial_expression_set *out_value);
407
408 /*!
409 * @brief Get the body skeleton in T-pose, used to query the skeleton hierarchy, scale, proportions etc
410 *
411 * @param[in] xdev The device.
412 * @param[in] body_tracking_type The body joint set type (XR_FB_body_tracking,
413 * XR_META_body_tracking_full_body, etc).
414 * @param[in] out_value The body skeleton hierarchy/properties.
415 *
416 * @see xrt_input_name
417 */
418 xrt_result_t (*get_body_skeleton)(struct xrt_device *xdev,
419 enum xrt_input_name body_tracking_type,
420 struct xrt_body_skeleton *out_value);
421
422 /*!
423 * @brief Get the joint locations for a body tracker
424 *
425 * @param[in] xdev The device.
426 * @param[in] body_tracking_type The body joint set type (XR_FB_body_tracking,
427 * XR_META_body_tracking_full_body, etc).
428 * @param[in] desired_timestamp_ns If the device can predict or has a history
429 * of locations, this is when the caller
430 * @param[in] out_value Set of body joint locations & properties.
431 *
432 * @see xrt_input_name
433 */
434 xrt_result_t (*get_body_joints)(struct xrt_device *xdev,
435 enum xrt_input_name body_tracking_type,
436 int64_t desired_timestamp_ns,
437 struct xrt_body_joint_set *out_value);
438
439 /*!
440 * @brief XR_META_body_tracking_calibration - body tracking extension to reset the body tracking calibration
441 *
442 * @param[in] xdev The body tracking device.
443 */
444 xrt_result_t (*reset_body_tracking_calibration_meta)(struct xrt_device *xdev);
445
446 /*!
447 * @brief XR_META_body_tracking_calibration - body tracking extension to suggest a body tracking calibration
448 * override
449 *
450 * @param[in] xdev The body tracking device.
451 * @param[in] new_body_height The suggested new body height to override.
452 */
454
455 /*!
456 * Set a output value.
457 *
458 * @param[in] xdev The device.
459 * @param[in] name The output component name to set.
460 * @param[in] value The value to set the output to.
461 * @see xrt_output_name
462 */
465 const struct xrt_output_value *value);
466
467 /*!
468 * Gets limits of this devices outputs.
469 *
470 * @param[in] xdev The device.
471 * @param[out] limits The returned limits.
472 */
473 xrt_result_t (*get_output_limits)(struct xrt_device *xdev, struct xrt_output_limits *limits);
474
475 /*!
476 * @brief Get current presence status of the device.
477 *
478 * @param[in] xdev The device.
479 * @param[out] presence The returned presence status.
480 */
481 xrt_result_t (*get_presence)(struct xrt_device *xdev, bool *presence);
482
483 /*!
484 * Begin a plane detection request
485 *
486 * @param[in] xdev The device.
487 * @param[in] begin_info The query specifying what type of planes are requested.
488 * @param[in] plane_detection_id The id for a previous plane detection request to be replaced or 0.
489 * @param[out] out_plane_detection_id The id of the new plane detection request generated by the xdev.
490 * @return generally XRT_SUCCESS, except for internal runtime failures.
491 */
493 const struct xrt_plane_detector_begin_info_ext *begin_info,
494 uint64_t plane_detection_id,
495 uint64_t *out_plane_detection_id);
496
497 /*!
498 * Destroy internal resources associated with plane_detector_id.
499 *
500 * @param[in] xdev The device.
501 * @param[in] plane_detection_id An id generated by the xdev.
502 * @return generally XRT_SUCCESS, except for internal runtime failures.
503 */
504 enum xrt_result (*destroy_plane_detection_ext)(struct xrt_device *xdev, uint64_t plane_detection_id);
505
506 /*!
507 * Get the state of a plane detection request.
508 *
509 * @param[in] xdev The device.
510 * @param[in] plane_detector_id An id generated by the xdev.
511 * @param[out] out_state The state of the plane detection.
512 * @return generally XRT_SUCCESS, except for internal runtime failures.
513 */
515 uint64_t plane_detection_id,
516 enum xrt_plane_detector_state_ext *out_state);
517
518 /*!
519 * Get results of a plane detection request.
520 *
521 * @param[in] xdev The device.
522 * @param[in] plane_detector_id An id generated by the xdev.
523 * @param[out] detections The detected planes, if any.
524 * @return generally XRT_SUCCESS, except for internal runtime failures.
525 */
527 uint64_t plane_detection_id,
528 struct xrt_plane_detections_ext *out_detections);
529
530 /*!
531 * @brief Get the per-view pose in relation to the view space.
532 *
533 * On most devices with coplanar displays and no built-in eye tracking
534 * or IPD sensing, this just calls a helper to process the provided
535 * eye relation, but this may also handle canted displays as well as
536 * eye tracking.
537 *
538 * Incorporates a call to xrt_device::get_tracked_pose or a wrapper for it
539 *
540 * @param[in] xdev The device.
541 * @param[in] default_eye_relation
542 * The interpupillary relation as a 3D position.
543 * Most simple stereo devices would just want to
544 * set `out_pose->position.[x|y|z] = ipd.[x|y|z]
545 * / 2.0f` and adjust for left vs right view.
546 * Not to be confused with IPD that is absolute
547 * distance, this is a full 3D translation
548 * If a device has a more accurate/dynamic way of
549 * knowing the eye relation, it may ignore this
550 * input.
551 * @param[in] at_timestamp_ns This is when the caller wants the poses and FOVs to be from.
552 * @param[in] view_count Number of views.
553 * @param[out] out_head_relation
554 * The head pose in the device tracking space.
555 * Combine with @p out_poses to get the views in
556 * device tracking space.
557 * @param[out] out_fovs An array (of size @p view_count ) to populate
558 * with the device-suggested fields of view.
559 * @param[out] out_poses An array (of size @p view_count ) to populate
560 * with view output poses in head space. When
561 * implementing, be sure to also set orientation:
562 * most likely identity orientation unless you
563 * have canted screens.
564 * (Caution: Even if you have eye tracking, you
565 * won't use eye orientation here!)
566 */
567 xrt_result_t (*get_view_poses)(struct xrt_device *xdev,
568 const struct xrt_vec3 *default_eye_relation,
569 int64_t at_timestamp_ns,
570 uint32_t view_count,
571 struct xrt_space_relation *out_head_relation,
572 struct xrt_fov *out_fovs,
573 struct xrt_pose *out_poses);
574
575 /**
576 * Compute the distortion at a single point.
577 *
578 * The input is @p u @p v in screen/output space (that is, predistorted), you are to compute and return the u,v
579 * coordinates to sample the render texture. The compositor will step through a range of u,v parameters to build
580 * the lookup (vertex attribute or distortion texture) used to pre-distort the image as required by the device's
581 * optics.
582 *
583 * @param xdev the device
584 * @param view the view index
585 * @param u horizontal texture coordinate
586 * @param v vertical texture coordinate
587 * @param[out] out_result corresponding u,v pairs for all three color channels.
588 */
589 xrt_result_t (*compute_distortion)(
590 struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result);
591
592 /*!
593 * Get the visibility mask for this device.
594 *
595 * @param[in] xdev The device.
596 * @param[in] type The type of visibility mask.
597 * @param[in] view_index The index of the view to get the mask for.
598 * @param[out] out_mask Output mask, caller must free.
599 */
600 xrt_result_t (*get_visibility_mask)(struct xrt_device *xdev,
601 enum xrt_visibility_mask_type type,
602 uint32_t view_index,
603 struct xrt_visibility_mask **out_mask);
604
605 /*!
606 * Called by the @ref xrt_space_overseer when a reference space that is
607 * implemented by this device is first used, or when the last usage of
608 * the reference space stops.
609 *
610 * What is provided is both the @ref xrt_reference_space_type that
611 * triggered the usage change and the @ref xrt_input_name (if any) that
612 * is used to drive the space.
613 *
614 * @see xrt_space_overseer_ref_space_inc
615 * @see xrt_space_overseer_ref_space_dec
616 * @see xrt_input_name
617 * @see xrt_reference_space_type
618 */
619 xrt_result_t (*ref_space_usage)(struct xrt_device *xdev,
620 enum xrt_reference_space_type type,
621 enum xrt_input_name name,
622 bool used);
623
624 /*!
625 * @brief Check if given form factor is available or not.
626 *
627 * This should only be used in HMD device, if the device driver supports form factor check.
628 *
629 * @param[in] xdev The device.
630 * @param[in] form_factor Form factor to check.
631 *
632 * @return true if given form factor is available; otherwise false.
633 */
634 bool (*is_form_factor_available)(struct xrt_device *xdev, enum xrt_form_factor form_factor);
635
636 /*!
637 * @brief Get battery status information.
638 *
639 * @param[in] xdev The device.
640 * @param[out] out_present Whether battery status information exist for this device.
641 * @param[out] out_charging Whether the device's battery is being charged.
642 * @param[out] out_charge Battery charge as a value between 0 and 1.
643 */
645 bool *out_present,
646 bool *out_charging,
647 float *out_charge);
648
649 /*!
650 * @brief Get the current display brightness.
651 *
652 * @param[in] xdev The device.
653 * @param[out] out_brightness Current display brightness. Usually between 0 and 1. Some devices may
654 * exceed 1 if the supported range exceeds 100%
655 */
656 xrt_result_t (*get_brightness)(struct xrt_device *xdev, float *out_brightness);
657
658 /*!
659 * @brief Set the display brightness.
660 *
661 * @param[in] xdev The device.
662 * @param[in] brightness Desired display brightness. Usually between 0 and 1. Some devices may
663 * allow exceeding 1 if the supported range exceeds 100%, but it will be clamped to
664 * the supported range.
665 * @param[in] relative Whether to add \a brightness to the current brightness, instead of overwriting
666 * the current brightness.
667 */
668 xrt_result_t (*set_brightness)(struct xrt_device *xdev, float brightness, bool relative);
669
670 /*!
671 * Enable the feature for this device.
672 *
673 * @param[in] xdev The device.
674 * @param[in] type The type of device feature.
675 */
677
678 /*!
679 * Disable the feature for this device.
680 *
681 * @param[in] xdev The device.
682 * @param[in] type The type of device feature.
683 */
685
686 /*!
687 * Destroy device.
688 */
689 void (*destroy)(struct xrt_device *xdev);
690
691 // Add new functions above destroy.
692};
693
694/*!
695 * Helper function for @ref xrt_device::update_inputs.
696 *
697 * @copydoc xrt_device::update_inputs
698 *
699 * @public @memberof xrt_device
700 */
701static inline xrt_result_t
703{
704 return xdev->update_inputs(xdev);
705}
706
707/*!
708 * Helper function for @ref xrt_device::get_tracked_pose.
709 *
710 * @copydoc xrt_device::get_tracked_pose
711 *
712 * @public @memberof xrt_device
713 */
714static inline xrt_result_t
716 enum xrt_input_name name,
717 int64_t at_timestamp_ns,
718 struct xrt_space_relation *out_relation)
719{
720 return xdev->get_tracked_pose(xdev, name, at_timestamp_ns, out_relation);
721}
722
723/*!
724 * Helper function for @ref xrt_device::get_hand_tracking.
725 *
726 * @copydoc xrt_device::get_hand_tracking
727 *
728 * @public @memberof xrt_device
729 */
730static inline xrt_result_t
732 enum xrt_input_name name,
733 int64_t desired_timestamp_ns,
734 struct xrt_hand_joint_set *out_value,
735 int64_t *out_timestamp_ns)
736{
737 return xdev->get_hand_tracking(xdev, name, desired_timestamp_ns, out_value, out_timestamp_ns);
738}
739
740/*!
741 * Helper function for @ref xrt_device::get_face_tracking.
742 *
743 * @copydoc xrt_device::get_face_tracking
744 *
745 * @public @memberof xrt_device
746 */
747static inline xrt_result_t
749 enum xrt_input_name facial_expression_type,
750 int64_t at_timestamp_ns,
751 struct xrt_facial_expression_set *out_value)
752{
753 return xdev->get_face_tracking(xdev, facial_expression_type, at_timestamp_ns, out_value);
754}
755
756/*!
757 * Helper function for @ref xrt_device::get_body_skeleton.
758 *
759 * @copydoc xrt_device::get_body_skeleton
760 *
761 * @public @memberof xrt_device
762 */
763static inline xrt_result_t
765 enum xrt_input_name body_tracking_type,
766 struct xrt_body_skeleton *out_value)
767{
768 return xdev->get_body_skeleton(xdev, body_tracking_type, out_value);
769}
770
771/*!
772 * Helper function for @ref xrt_device::get_body_joints.
773 *
774 * @copydoc xrt_device::get_body_joints
775 *
776 * @public @memberof xrt_device
777 */
778static inline xrt_result_t
780 enum xrt_input_name body_tracking_type,
781 int64_t desired_timestamp_ns,
782 struct xrt_body_joint_set *out_value)
783{
784 return xdev->get_body_joints(xdev, body_tracking_type, desired_timestamp_ns, out_value);
785}
786
787/*!
788 * Helper function for @ref xrt_device::reset_body_tracking_calibration_meta.
789 *
790 * @copydoc xrt_device::reset_body_tracking_calibration_meta
791 *
792 * @public @memberof xrt_device
793 */
794static inline xrt_result_t
796{
797 if (xdev->reset_body_tracking_calibration_meta == NULL) {
799 }
800 return xdev->reset_body_tracking_calibration_meta(xdev);
801}
802
803/*!
804 * Helper function for @ref xrt_device::set_body_tracking_calibration_override_meta.
805 *
806 * @copydoc xrt_device::set_body_tracking_calibration_override_meta
807 *
808 * @public @memberof xrt_device
809 */
810static inline xrt_result_t
812{
815 }
816 return xdev->set_body_tracking_calibration_override_meta(xdev, new_body_height);
817}
818
819/*!
820 * Helper function for @ref xrt_device::set_output.
821 *
822 * @copydoc xrt_device::set_output
823 *
824 * @public @memberof xrt_device
825 */
826static inline xrt_result_t
828{
829 xdev->set_output(xdev, name, value);
830 return XRT_SUCCESS;
831}
832
833static inline xrt_result_t
834xrt_device_get_output_limits(struct xrt_device *xdev, struct xrt_output_limits *limits)
835{
836 if (xdev->get_output_limits) {
837 return xdev->get_output_limits(xdev, limits);
838 } else {
840 }
841}
842
843/*!
844 * Helper function for @ref xrt_device::get_presence.
845 *
846 * @copydoc xrt_device::get_presence
847 *
848 * @public @memberof xrt_device
849 */
850static inline xrt_result_t
851xrt_device_get_presence(struct xrt_device *xdev, bool *presence)
852{
853 if (xdev->get_presence) {
854 return xdev->get_presence(xdev, presence);
855 } else {
857 }
858}
859
860/*!
861 * Helper function for @ref xrt_device::begin_plane_detection.
862 *
863 * @public @memberof xrt_device
864 */
865static inline enum xrt_result
867 const struct xrt_plane_detector_begin_info_ext *begin_info,
868 uint64_t plane_detection_id,
869 uint64_t *out_plane_detection_id)
870{
871 return xdev->begin_plane_detection_ext(xdev, begin_info, plane_detection_id, out_plane_detection_id);
872}
873
874/*!
875 * Helper function for @ref xrt_device::destroy_plane_detection.
876 *
877 * @public @memberof xrt_device
878 */
879static inline enum xrt_result
880xrt_device_destroy_plane_detection_ext(struct xrt_device *xdev, uint64_t plane_detection_id)
881{
882 return xdev->destroy_plane_detection_ext(xdev, plane_detection_id);
883}
884
885/*!
886 * Helper function for @ref xrt_device::get_plane_detections.
887 *
888 * @public @memberof xrt_device
889 */
890static inline enum xrt_result
892 uint64_t plane_detection_id,
893 enum xrt_plane_detector_state_ext *out_state)
894{
895 return xdev->get_plane_detection_state_ext(xdev, plane_detection_id, out_state);
896}
897
898/*!
899 * Helper function for @ref xrt_device::get_plane_detections.
900 *
901 * @public @memberof xrt_device
902 */
903static inline enum xrt_result
905 uint64_t plane_detection_id,
906 struct xrt_plane_detections_ext *out_detections)
907{
908 return xdev->get_plane_detections_ext(xdev, plane_detection_id, out_detections);
909}
910
911/*!
912 * Helper function for @ref xrt_device::get_view_poses.
913 *
914 * @copydoc xrt_device::get_view_poses
915 * @public @memberof xrt_device
916 */
917static inline xrt_result_t
919 const struct xrt_vec3 *default_eye_relation,
920 int64_t at_timestamp_ns,
921 uint32_t view_count,
922 struct xrt_space_relation *out_head_relation,
923 struct xrt_fov *out_fovs,
924 struct xrt_pose *out_poses)
925{
926 return xdev->get_view_poses(xdev, default_eye_relation, at_timestamp_ns, view_count, out_head_relation,
927 out_fovs, out_poses);
928}
929
930/*!
931 * Helper function for @ref xrt_device::compute_distortion.
932 *
933 * @copydoc xrt_device::compute_distortion
934 *
935 * @public @memberof xrt_device
936 */
937static inline xrt_result_t
939 struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
940{
941 return xdev->compute_distortion(xdev, view, u, v, out_result);
942}
943
944/*!
945 * Helper function for @ref xrt_device::get_visibility_mask.
946 *
947 * @copydoc xrt_device::get_visibility_mask
948 *
949 * @public @memberof xrt_device
950 */
951static inline xrt_result_t
953 enum xrt_visibility_mask_type type,
954 uint32_t view_index,
955 struct xrt_visibility_mask **out_mask)
956{
957 return xdev->get_visibility_mask(xdev, type, view_index, out_mask);
958}
959
960/*!
961 * Helper function for @ref xrt_device::ref_space_usage.
962 *
963 * @copydoc xrt_device::ref_space_usage
964 *
965 * @public @memberof xrt_device
966 */
967static inline xrt_result_t
969 enum xrt_reference_space_type type,
970 enum xrt_input_name name,
971 bool used)
972{
973 return xdev->ref_space_usage(xdev, type, name, used);
974}
975
976/*!
977 * Helper function for @ref xrt_device::is_form_factor_available.
978 *
979 * @copydoc xrt_device::is_form_factor_available
980 *
981 * @public @memberof xrt_device
982 */
983static inline bool
985{
986 return xdev->is_form_factor_available(xdev, form_factor);
987}
988
989/*!
990 * Helper function for @ref xrt_device::get_battery_status.
991 *
992 * @copydoc xrt_device::get_battery_status
993 *
994 * @public @memberof xrt_device
995 */
996static inline xrt_result_t
997xrt_device_get_battery_status(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
998{
999 return xdev->get_battery_status(xdev, out_present, out_charging, out_charge);
1000}
1001
1002/*!
1003 * Helper function for @ref xrt_device::get_brightness.
1004 *
1005 * @copydoc xrt_device::get_brightness
1006 * @public @memberof xrt_device
1007 */
1008static inline xrt_result_t
1009xrt_device_get_brightness(struct xrt_device *xdev, float *out_brightness)
1010{
1011 return xdev->get_brightness(xdev, out_brightness);
1012}
1013
1014/*!
1015 * Helper function for @ref xrt_device::set_brightness.
1016 *
1017 * @copydoc xrt_device::set_brightness
1018 * @public @memberof xrt_device
1019 */
1020static inline xrt_result_t
1021xrt_device_set_brightness(struct xrt_device *xdev, float brightness, bool relative)
1022{
1023 return xdev->set_brightness(xdev, brightness, relative);
1024}
1025
1026/*!
1027 * Helper function for @ref xrt_device::begin_feature.
1028 *
1029 * @copydoc xrt_device::begin_feature
1030 *
1031 * @public @memberof xrt_device
1032 */
1033static inline xrt_result_t
1035{
1036 return xdev->begin_feature(xdev, type);
1037}
1038
1039/*!
1040 * Helper function for @ref xrt_device::end_feature.
1041 *
1042 * @copydoc xrt_device::end_feature
1043 *
1044 * @public @memberof xrt_device
1045 */
1046static inline xrt_result_t
1048{
1049 return xdev->end_feature(xdev, type);
1050}
1051
1052/*!
1053 * Helper function for @ref xrt_device::destroy.
1054 *
1055 * Handles nulls, sets your pointer to null.
1056 *
1057 * @public @memberof xrt_device
1058 */
1059static inline void
1061{
1062 struct xrt_device *xdev = *xdev_ptr;
1063 if (xdev == NULL) {
1064 return;
1065 }
1066
1067 xdev->destroy(xdev);
1068 *xdev_ptr = NULL;
1069}
1070
1071
1072#ifdef __cplusplus
1073} // extern "C"
1074#endif
xrt_plane_detection_capability_flags_ext
Caps for a plane detector, see xrt_device.
Definition: xrt_plane_detector.h:30
xrt_visibility_mask_type
Visibility mask, mirror of XrVisibilityMaskKHR.
Definition: xrt_defines.h:2164
xrt_blend_mode
Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode.
Definition: xrt_defines.h:112
xrt_form_factor
What form factor is this device, mostly maps onto OpenXR's XrFormFactor.
Definition: xrt_defines.h:2114
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition: xrt_defines.h:1344
enum xrt_result xrt_result_t
Result type used across Monado.
xrt_reference_space_type
Type of a OpenXR mapped reference space, maps to the semantic spaces on the xrt_space_overseer struct...
Definition: xrt_defines.h:612
xrt_output_name
Name of a output with a baked in type.
Definition: xrt_defines.h:1974
xrt_result
Result type used across Monado.
Definition: xrt_results.h:23
xrt_plane_detector_state_ext
State of a plane detector, see xrt_device.
Definition: xrt_plane_detector.h:83
xrt_device_type
How an xrt_device can be used.
Definition: xrt_defines.h:804
@ XRT_SUCCESS
The operation succeeded.
Definition: xrt_results.h:27
@ XRT_ERROR_NOT_IMPLEMENTED
The interface function called is not implemented by its interface.
Definition: xrt_results.h:192
A binding pair, going from a binding point to a device input.
Definition: xrt_device.h:194
enum xrt_input_name device
To input on the device.
Definition: xrt_device.h:196
enum xrt_input_name from
From which name.
Definition: xrt_device.h:195
A binding pair, going from a binding point to a device output.
Definition: xrt_device.h:205
enum xrt_output_name device
To output on the device.
Definition: xrt_device.h:207
enum xrt_output_name from
From which name.
Definition: xrt_device.h:206
A binding profile, has lists of binding pairs to goes from device in name to the device it hangs off ...
Definition: xrt_device.h:217
enum xrt_device_name name
Device this binding emulates.
Definition: xrt_device.h:219
Definition: xrt_defines.h:1957
Definition: xrt_defines.h:1914
Static data of supported features of the xrt_device this struct sits on.
Definition: xrt_device.h:256
A single HMD or input device.
Definition: xrt_device.h:284
static xrt_result_t xrt_device_get_tracked_pose(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Helper function for xrt_device::get_tracked_pose.
Definition: xrt_device.h:715
enum xrt_result(* destroy_plane_detection_ext)(struct xrt_device *xdev, uint64_t plane_detection_id)
Destroy internal resources associated with plane_detector_id.
Definition: xrt_device.h:504
static enum xrt_result xrt_device_get_plane_detections_ext(struct xrt_device *xdev, uint64_t plane_detection_id, struct xrt_plane_detections_ext *out_detections)
Helper function for xrt_device::get_plane_detections.
Definition: xrt_device.h:904
xrt_result_t(* get_body_skeleton)(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
Get the body skeleton in T-pose, used to query the skeleton hierarchy, scale, proportions etc.
Definition: xrt_device.h:418
xrt_result_t(* reset_body_tracking_calibration_meta)(struct xrt_device *xdev)
XR_META_body_tracking_calibration - body tracking extension to reset the body tracking calibration.
Definition: xrt_device.h:444
static xrt_result_t xrt_device_begin_feature(struct xrt_device *xdev, enum xrt_device_feature_type type)
Helper function for xrt_device::begin_feature.
Definition: xrt_device.h:1034
static xrt_result_t xrt_device_get_view_poses(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
Helper function for xrt_device::get_view_poses.
Definition: xrt_device.h:918
static xrt_result_t xrt_device_get_hand_tracking(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
Helper function for xrt_device::get_hand_tracking.
Definition: xrt_device.h:731
xrt_result_t(* get_body_joints)(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
Get the joint locations for a body tracker.
Definition: xrt_device.h:434
xrt_result_t(* ref_space_usage)(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
Called by the xrt_space_overseer when a reference space that is implemented by this device is first u...
Definition: xrt_device.h:619
xrt_result_t(* get_presence)(struct xrt_device *xdev, bool *presence)
Get current presence status of the device.
Definition: xrt_device.h:481
xrt_result_t(* set_output)(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
Set a output value.
Definition: xrt_device.h:463
xrt_result_t(* compute_distortion)(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
Compute the distortion at a single point.
Definition: xrt_device.h:589
static xrt_result_t xrt_device_update_inputs(struct xrt_device *xdev)
Helper function for xrt_device::update_inputs.
Definition: xrt_device.h:702
xrt_result_t(* set_body_tracking_calibration_override_meta)(struct xrt_device *xdev, float new_body_height)
XR_META_body_tracking_calibration - body tracking extension to suggest a body tracking calibration ov...
Definition: xrt_device.h:453
static enum xrt_result xrt_device_destroy_plane_detection_ext(struct xrt_device *xdev, uint64_t plane_detection_id)
Helper function for xrt_device::destroy_plane_detection.
Definition: xrt_device.h:880
xrt_result_t(* get_output_limits)(struct xrt_device *xdev, struct xrt_output_limits *limits)
Gets limits of this devices outputs.
Definition: xrt_device.h:473
static xrt_result_t xrt_device_ref_space_usage(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
Helper function for xrt_device::ref_space_usage.
Definition: xrt_device.h:968
static xrt_result_t xrt_device_reset_body_tracking_calibration_meta(struct xrt_device *xdev)
Helper function for xrt_device::reset_body_tracking_calibration_meta.
Definition: xrt_device.h:795
xrt_result_t(* get_hand_tracking)(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
Get relationship of hand joints to the tracking origin space as the base space.
Definition: xrt_device.h:385
static xrt_result_t xrt_device_get_face_tracking(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
Helper function for xrt_device::get_face_tracking.
Definition: xrt_device.h:748
xrt_result_t(* get_visibility_mask)(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
Get the visibility mask for this device.
Definition: xrt_device.h:600
struct xrt_hmd_parts * hmd
Null if this device does not interface with the users head.
Definition: xrt_device.h:296
xrt_result_t(* get_face_tracking)(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
Get the requested blend shape properties & weights for a face tracker.
Definition: xrt_device.h:403
static xrt_result_t xrt_device_compute_distortion(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
Helper function for xrt_device::compute_distortion.
Definition: xrt_device.h:938
struct xrt_output * outputs
Array of output structs.
Definition: xrt_device.h:314
xrt_result_t(* begin_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type)
Enable the feature for this device.
Definition: xrt_device.h:676
static xrt_result_t xrt_device_get_presence(struct xrt_device *xdev, bool *presence)
Helper function for xrt_device::get_presence.
Definition: xrt_device.h:851
size_t output_count
Number of outputs.
Definition: xrt_device.h:312
bool(* is_form_factor_available)(struct xrt_device *xdev, enum xrt_form_factor form_factor)
Check if given form factor is available or not.
Definition: xrt_device.h:634
xrt_result_t(* set_brightness)(struct xrt_device *xdev, float brightness, bool relative)
Set the display brightness.
Definition: xrt_device.h:668
struct xrt_input * inputs
Array of input structs.
Definition: xrt_device.h:309
static xrt_result_t xrt_device_get_body_skeleton(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
Helper function for xrt_device::get_body_skeleton.
Definition: xrt_device.h:764
size_t input_count
Number of inputs.
Definition: xrt_device.h:307
xrt_result_t(* get_battery_status)(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
Get battery status information.
Definition: xrt_device.h:644
enum xrt_result(* get_plane_detections_ext)(struct xrt_device *xdev, uint64_t plane_detection_id, struct xrt_plane_detections_ext *out_detections)
Get results of a plane detection request.
Definition: xrt_device.h:526
void(* destroy)(struct xrt_device *xdev)
Destroy device.
Definition: xrt_device.h:689
xrt_result_t(* get_view_poses)(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
Get the per-view pose in relation to the view space.
Definition: xrt_device.h:567
xrt_result_t(* get_brightness)(struct xrt_device *xdev, float *out_brightness)
Get the current display brightness.
Definition: xrt_device.h:656
static xrt_result_t xrt_device_set_brightness(struct xrt_device *xdev, float brightness, bool relative)
Helper function for xrt_device::set_brightness.
Definition: xrt_device.h:1021
static xrt_result_t xrt_device_end_feature(struct xrt_device *xdev, enum xrt_device_feature_type type)
Helper function for xrt_device::end_feature.
Definition: xrt_device.h:1047
xrt_result_t(* update_inputs)(struct xrt_device *xdev)
Update any attached inputs.
Definition: xrt_device.h:331
static xrt_result_t xrt_device_get_body_joints(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
Helper function for xrt_device::get_body_joints.
Definition: xrt_device.h:779
static xrt_result_t xrt_device_set_body_tracking_calibration_override_meta(struct xrt_device *xdev, float new_body_height)
Helper function for xrt_device::set_body_tracking_calibration_override_meta.
Definition: xrt_device.h:811
enum xrt_result(* get_plane_detection_state_ext)(struct xrt_device *xdev, uint64_t plane_detection_id, enum xrt_plane_detector_state_ext *out_state)
Get the state of a plane detection request.
Definition: xrt_device.h:514
static enum xrt_result xrt_device_begin_plane_detection_ext(struct xrt_device *xdev, const struct xrt_plane_detector_begin_info_ext *begin_info, uint64_t plane_detection_id, uint64_t *out_plane_detection_id)
Helper function for xrt_device::begin_plane_detection.
Definition: xrt_device.h:866
struct xrt_tracking_origin * tracking_origin
Always set, pointing to the tracking system for this device.
Definition: xrt_device.h:299
xrt_result_t(* end_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type)
Disable the feature for this device.
Definition: xrt_device.h:684
size_t binding_profile_count
Number of bindings in xrt_device::binding_profiles.
Definition: xrt_device.h:302
enum xrt_result(* begin_plane_detection_ext)(struct xrt_device *xdev, const struct xrt_plane_detector_begin_info_ext *begin_info, uint64_t plane_detection_id, uint64_t *out_plane_detection_id)
Begin a plane detection request.
Definition: xrt_device.h:492
static enum xrt_result xrt_device_get_plane_detection_state_ext(struct xrt_device *xdev, uint64_t plane_detection_id, enum xrt_plane_detector_state_ext *out_state)
Helper function for xrt_device::get_plane_detections.
Definition: xrt_device.h:891
enum xrt_device_name name
Enum identifier of the device.
Definition: xrt_device.h:286
static xrt_result_t xrt_device_get_visibility_mask(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
Helper function for xrt_device::get_visibility_mask.
Definition: xrt_device.h:952
static bool xrt_device_is_form_factor_available(struct xrt_device *xdev, enum xrt_form_factor form_factor)
Helper function for xrt_device::is_form_factor_available.
Definition: xrt_device.h:984
static xrt_result_t xrt_device_get_brightness(struct xrt_device *xdev, float *out_brightness)
Helper function for xrt_device::get_brightness.
Definition: xrt_device.h:1009
static void xrt_device_destroy(struct xrt_device **xdev_ptr)
Helper function for xrt_device::destroy.
Definition: xrt_device.h:1060
xrt_result_t(* get_tracked_pose)(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Get relationship of a tracked device to the tracking origin space as the base space.
Definition: xrt_device.h:357
static xrt_result_t xrt_device_get_battery_status(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
Helper function for xrt_device::get_battery_status.
Definition: xrt_device.h:997
static xrt_result_t xrt_device_set_output(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
Helper function for xrt_device::set_output.
Definition: xrt_device.h:827
Definition: xrt_defines.h:1692
Describes a projection matrix fov.
Definition: xrt_defines.h:499
Joint set type used for hand tracking.
Definition: xrt_defines.h:1443
All of the device components that deals with interfacing to a users head.
Definition: xrt_device.h:92
float * vertices
Data.
Definition: xrt_device.h:136
struct xrt_fov fov[XRT_MAX_VIEWS]
distortion is subject to the field of view
Definition: xrt_device.h:155
uint32_t vertex_count
Number of vertices.
Definition: xrt_device.h:138
struct xrt_view views[XRT_MAX_VIEWS]
Display information.
Definition: xrt_device.h:114
uint64_t nominal_frame_interval_ns
Nominal frame interval.
Definition: xrt_device.h:104
uint32_t stride
Stride of vertices.
Definition: xrt_device.h:140
enum xrt_blend_mode blend_modes[XRT_MAX_DEVICE_BLEND_MODES]
Array of supported blend modes.
Definition: xrt_device.h:120
int * indices
Indices, for triangle strip.
Definition: xrt_device.h:145
enum xrt_distortion_model models
Supported distortion models, a bitfield.
Definition: xrt_device.h:129
struct xrt_hmd_parts::@252 distortion
Distortion information.
struct xrt_hmd_parts::@251 screens[1]
The hmd screen as an unrotated display, like the HMD presents it to the OS.
uint32_t index_count_total
Total number of elements in mesh::indices array.
Definition: xrt_device.h:151
uint32_t index_offsets[XRT_MAX_VIEWS]
Offsets for the indices (one offset per view).
Definition: xrt_device.h:149
uint32_t uv_channels_count
1 or 3 for (chromatic aberration).
Definition: xrt_device.h:142
enum xrt_distortion_model preferred
Preferred disortion model, single value.
Definition: xrt_device.h:131
uint32_t index_counts[XRT_MAX_VIEWS]
Number of indices for the triangle strips (one per view).
Definition: xrt_device.h:147
A single named input, that sits on a xrt_device.
Definition: xrt_device.h:165
XRT_ALIGNAS(8) int64_t timestamp
alignas for 32 bit client support, see IPC Design and Implementation
bool active
Is this input active.
Definition: xrt_device.h:167
A tightly packed 2x2 matrix of floats.
Definition: xrt_defines.h:526
Output limits of a particular device.
Definition: xrt_device.h:242
float haptic_pcm_sample_rate
The sample rate of the device's haptic PCM support, 0 if haptic PCM is not supported.
Definition: xrt_device.h:244
A union of all output types.
Definition: xrt_defines.h:2092
A single named output, that sits on a xrt_device.
Definition: xrt_device.h:183
Each plane has n polygons; ultimately plane metadata from locations and vetices is reconstructed.
Definition: xrt_plane_detector.h:171
A query for a plane.
Definition: xrt_plane_detector.h:97
A pose composed of a position and orientation.
Definition: xrt_defines.h:479
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:670
A tracking system or device origin.
Definition: xrt_tracking.h:71
Represents a uv triplet for distortion, basically just three xrt_vec2.
Definition: xrt_defines.h:279
A 3 element vector with single floats.
Definition: xrt_defines.h:289
A per-lens/display view information.
Definition: xrt_device.h:35
struct xrt_matrix_2x2 rot
Rotation 2d matrix used to rotate the position of the output of the distortion shaders onto the scree...
Definition: xrt_device.h:81
struct xrt_view::@249 viewport
Viewport position on the screen.
struct xrt_view::@250 display
Physical properties of this display (or the part of a display that covers this view).
Visibility mask helper, the indices and vertices are tightly packed after this struct.
Definition: xrt_visibility_mask.h:25
A union of all input types.
Definition: xrt_defines.h:1459
Common defines and enums for XRT.
xrt_distortion_model
Which distortion model does the device expose, used both as a bitfield and value.
Definition: xrt_defines.h:167
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:724
xrt_scanout_direction
Screen scanout direction.
Definition: xrt_defines.h:179
xrt_device_feature_type
Higher level features for devices.
Definition: xrt_device.h:231
Header for limits of the XRT interfaces.
Header defining planes detector enum and structs.
Header defining visibility mask helper struct.