Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_input.h
Go to the documentation of this file.
1// Copyright 2018-2024, Collabora, Ltd.
2// Copyright 2023-2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Holds input related functions.
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @author Korcan Hussein <korcan.hussein@collabora.com>
9 * @ingroup oxr_main
10 */
11
12#pragma once
13
14#include "oxr_extension_support.h"
16
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23/*
24 *
25 * Action Set functions
26 *
27 */
28
29/*!
30 * @public @memberof oxr_instance
31 */
32XrResult
33oxr_action_set_create(struct oxr_logger *log,
34 struct oxr_instance *inst,
35 struct oxr_instance_action_context *inst_context,
36 const XrActionSetCreateInfo *createInfo,
37 struct oxr_action_set **out_act_set);
38
39/*!
40 * De-initialize an action set attachment and its action attachments.
41 *
42 * Frees the action attachments, but does not de-allocate the action set
43 * attachment.
44 *
45 * @public @memberof oxr_action_set_attachment
46 */
47void
48oxr_action_set_attachment_teardown(struct oxr_action_set_attachment *act_set_attached);
49
50
51/*
52 *
53 * Action functions
54 *
55 */
56
57/*!
58 * @public @memberof oxr_action
59 */
60XrResult
61oxr_action_create(struct oxr_logger *log,
62 struct oxr_action_set *act_set,
63 const XrActionCreateInfo *createInfo,
64 struct oxr_action **out_act);
65
66
67/*
68 *
69 * Subaction path functions
70 *
71 */
72
73/*!
74 * Helper function to classify subaction_paths.
75 *
76 * Sets all members of @p subaction_paths ( @ref oxr_subaction_paths ) as
77 * appropriate based on the subaction paths found in the list.
78 *
79 * If no paths are provided, @p subaction_paths->any will be true.
80 *
81 * @return false if an invalid subaction path is provided.
82 *
83 * @public @memberof oxr_instance
84 * @see oxr_subaction_paths
85 */
86bool
87oxr_classify_subaction_paths(struct oxr_logger *log,
88 const struct oxr_instance *inst,
89 uint32_t subaction_path_count,
90 const XrPath *subaction_paths,
91 struct oxr_subaction_paths *subaction_paths_out);
92
93
94/*
95 *
96 * Action input/output functions
97 *
98 */
99
100/*!
101 * Find the pose input for the set of subaction_paths
102 *
103 * @public @memberof oxr_session
104 */
105XrResult
106oxr_action_get_pose_input(struct oxr_session *sess,
107 uint32_t act_key,
108 const struct oxr_subaction_paths *subaction_paths_ptr,
109 struct oxr_action_input **out_input);
110
111void
112oxr_action_cache_stop_output(struct oxr_logger *log, struct oxr_session *sess, struct oxr_action_cache *cache);
113
114
115/*
116 *
117 * Session action functions
118 *
119 */
120
121/*!
122 * Given an action act_key, look up the @ref oxr_action_attachment of
123 * the associated action in the given Session.
124 *
125 * @private @memberof oxr_session
126 */
127void
128oxr_session_get_action_attachment(struct oxr_session *sess,
129 uint32_t act_key,
130 struct oxr_action_attachment **out_act_attached);
131
132/*!
133 * @public @memberof oxr_session
134 * @see oxr_action_set
135 */
136XrResult
137oxr_session_attach_action_sets(struct oxr_logger *log,
138 struct oxr_session *sess,
139 const XrSessionActionSetsAttachInfo *bindInfo);
140
141/*!
142 * @public @memberof oxr_session
143 */
144XrResult
146 struct oxr_session *sess,
147 uint32_t countActionSets,
148 const XrActiveActionSet *actionSets,
149 const XrActiveActionSetPrioritiesEXT *activePriorities);
150
151/*!
152 * @public @memberof oxr_session
153 */
154XrResult
155oxr_action_enumerate_bound_sources(struct oxr_logger *log,
156 struct oxr_session *sess,
157 uint32_t act_key,
158 uint32_t sourceCapacityInput,
159 uint32_t *sourceCountOutput,
160 XrPath *sources);
161
162
163#ifdef __cplusplus
164}
165#endif
Forward declarations for OpenXR state tracker structs.
XrResult oxr_action_sync_data(struct oxr_logger *log, struct oxr_session *sess, uint32_t countActionSets, const XrActiveActionSet *actionSets, const XrActiveActionSetPrioritiesEXT *activePriorities)
Definition oxr_input.c:1972
Data associated with an Action that has been attached to a Session.
Definition oxr_objects.h:1788
The set of inputs/outputs for a single sub-action path for an action.
Definition oxr_objects.h:1766
A input action pair of a xrt_input and a xrt_device, along with the required transform.
Definition oxr_objects.h:1727
The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session)...
Definition oxr_objects.h:1669
A group of actions.
Definition oxr_objects.h:2048
A single action.
Definition oxr_objects.h:2118
Holds all action-related state that lives at the instance level (shared across sessions).
Definition oxr_instance_action_context.h:41
Main object that ties everything together.
Definition oxr_objects.h:1214
Logger struct that lives on the stack, one for each call client call.
Definition oxr_logger.h:44
Object that client program interact with.
Definition oxr_objects.h:1354
A parsed equivalent of a list of sub-action paths.
Definition oxr_objects.h:1630