Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_binding_point.h
Go to the documentation of this file.
1// Copyright 2026, NVIDIA CORPORATION.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Runtime binding point data cloned from generated templates.
6 * @ingroup oxr_main
7 */
8
9#pragma once
10
11#include "xrt/xrt_defines.h"
12
13#include "oxr_defines.h"
14#include "oxr_extension_support.h"
16#include "oxr_generated_bindings.h"
17#include "oxr_subaction_store.h"
18
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/*!
25 * Runtime metadata for one DPAD emulation source, for example
26 * `/user/hand/left/input/thumbstick`.
27 */
29{
30 //! Owning interaction profile.
32 //! Immutable generated source template.
33 const struct oxr_dpad_emulation_template *templ;
34 //! Runtime XrPath for the DPAD source path.
35 XrPath path;
36 //! Runtime XrPath for the top-level subaction path.
38 /*!
39 * XRT position input that DPAD regions are derived from,
40 * this must be of type @ref XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE.
41 */
43 //! Optional XRT input used to activate DPAD emulation.
45};
46
47/*!
48 * Payload for a binding point that directly targets an XRT input.
49 */
51{
52 //! XRT input name.
54};
55
56/*!
57 * Payload for a binding point that directly targets an XRT output.
58 */
60{
61 //! XRT output name.
63};
64
65/*!
66 * Payload for a binding point that resolves to another concrete binding point.
67 */
69{
70 XrPath boolean_path;
71 XrPath float_path;
72 XrPath vec2_path;
73 XrPath pose_path;
74 XrPath haptic_path;
75};
76
77/*!
78 * Payload for a binding point that represents a DPAD emulation region.
79 */
81{
82 //! DPAD emulation that backs this region.
84 //! Region represented by this binding point.
85 enum oxr_dpad_binding_point binding_point;
86};
87
88/*!
89 * Runtime description of one bindable path on an interaction profile.
90 *
91 * Binding points are cloned from generated templates into the
92 * @ref oxr_binding_registry and are never mutated after that. All generated
93 * points are present in the registry; API validation decides whether an app
94 * may suggest a particular path. The common fields identify the point and the
95 * union stores data valid for @ref kind.
96 *
97 * This is the object an @ref oxr_suggested_binding points to. The suggested
98 * binding is what the OpenXR client submits (via
99 * xrSuggestInteractionProfileBindings); it selects a path and stores a
100 * non-owning pointer to the matching registry binding point.
101 */
103{
104 //! Owning interaction profile.
106
107 //! Immutable generated source template.
108 const struct oxr_binding_point_template *templ;
109
110 //! Subaction path this binding point belongs to.
112
113 //! Runtime XrPath identity for this binding point.
114 XrPath path;
115
116 //! Unique source path returned to applications for this binding point.
118
119 //! User-facing localized name for this binding point.
120 const char *localized_name;
121
122 //! Runtime XrPath for the priority group used for action priority suppression.
124
125 //! Controls which fields are valid.
126 enum oxr_binding_point_kind kind;
127
128 //! Transform needed to interpret this binding point's raw input value.
129 enum oxr_binding_value_transform value_transform;
130
131 //! Kind-specific payload.
132 union {
133 struct oxr_binding_point_input input;
134 struct oxr_binding_point_output output;
135 struct oxr_binding_point_upgrade upgrade;
136 struct oxr_binding_point_dpad dpad;
137 };
138};
139
140
141/*!
142 * Short name for a binding point kind, for debug printing.
143 */
144static inline const char *
145oxr_binding_point_kind_to_string(enum oxr_binding_point_kind kind)
146{
147 switch (kind) {
148 case OXR_BINDING_POINT_KIND_INPUT: return "INPUT";
149 case OXR_BINDING_POINT_KIND_OUTPUT: return "OUTPUT";
150 case OXR_BINDING_POINT_KIND_UPGRADE: return "UPGRADE";
151 case OXR_BINDING_POINT_KIND_DPAD: return "DPAD";
152 default: return "UNKNOWN";
153 }
154}
155
156
157#ifdef __cplusplus
158}
159#endif
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition xrt_defines.h:952
xrt_output_name
Name of a output with a baked in type.
Definition xrt_defines.h:1636
static const char * oxr_binding_point_kind_to_string(enum oxr_binding_point_kind kind)
Short name for a binding point kind, for debug printing.
Definition oxr_binding_point.h:145
Shared internal defines and enums in the state tracker.
Forward declarations for OpenXR state tracker structs.
Store of registry-wide OpenXR subaction path payloads.
Payload for a binding point that represents a DPAD emulation region.
Definition oxr_binding_point.h:81
struct oxr_dpad_emulation * emulation
DPAD emulation that backs this region.
Definition oxr_binding_point.h:83
enum oxr_dpad_binding_point binding_point
Region represented by this binding point.
Definition oxr_binding_point.h:85
Payload for a binding point that directly targets an XRT input.
Definition oxr_binding_point.h:51
enum xrt_input_name name
XRT input name.
Definition oxr_binding_point.h:53
Payload for a binding point that directly targets an XRT output.
Definition oxr_binding_point.h:60
enum xrt_output_name name
XRT output name.
Definition oxr_binding_point.h:62
Payload for a binding point that resolves to another concrete binding point.
Definition oxr_binding_point.h:69
Runtime description of one bindable path on an interaction profile.
Definition oxr_binding_point.h:103
XrPath source_path
Unique source path returned to applications for this binding point.
Definition oxr_binding_point.h:117
struct oxr_binding_profile * profile
Owning interaction profile.
Definition oxr_binding_point.h:105
enum oxr_binding_point_kind kind
Controls which fields are valid.
Definition oxr_binding_point.h:126
enum oxr_binding_value_transform value_transform
Transform needed to interpret this binding point's raw input value.
Definition oxr_binding_point.h:129
XrPath priority_group
Runtime XrPath for the priority group used for action priority suppression.
Definition oxr_binding_point.h:123
const struct oxr_binding_point_template * templ
Immutable generated source template.
Definition oxr_binding_point.h:108
const struct oxr_binding_subaction * subaction
Subaction path this binding point belongs to.
Definition oxr_binding_point.h:111
XrPath path
Runtime XrPath identity for this binding point.
Definition oxr_binding_point.h:114
const char * localized_name
User-facing localized name for this binding point.
Definition oxr_binding_point.h:120
Runtime interaction profile binding data cloned from generated templates.
Definition oxr_binding_profile.h:26
Runtime payload for one OpenXR subaction path.
Definition oxr_subaction_store.h:33
Runtime metadata for one DPAD emulation source, for example /user/hand/left/input/thumbstick.
Definition oxr_binding_point.h:29
XrPath subaction_path
Runtime XrPath for the top-level subaction path.
Definition oxr_binding_point.h:37
struct oxr_binding_profile * profile
Owning interaction profile.
Definition oxr_binding_point.h:31
const struct oxr_dpad_emulation_template * templ
Immutable generated source template.
Definition oxr_binding_point.h:33
enum xrt_input_name activate
Optional XRT input used to activate DPAD emulation.
Definition oxr_binding_point.h:44
XrPath path
Runtime XrPath for the DPAD source path.
Definition oxr_binding_point.h:35
enum xrt_input_name input
XRT position input that DPAD regions are derived from, this must be of type XRT_INPUT_TYPE_VEC2_MINUS...
Definition oxr_binding_point.h:42
Common defines and enums for XRT.