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
62 struct oxr_action_set *act_set,
63 const XrActionCreateInfo *createInfo,
64 struct oxr_action **out_act);
65
66
67/*
68 *
69 * Action input/output functions
70 *
71 */
72
73/*!
74 * Find the pose input for the set of subaction_paths
75 *
76 * @public @memberof oxr_session
77 */
78XrResult
79oxr_action_get_pose_input(struct oxr_session *sess,
80 uint32_t act_key,
81 const struct oxr_subaction_paths *subaction_paths_ptr,
82 struct oxr_action_input **out_input);
83
84void
85oxr_action_cache_stop_output(struct oxr_logger *log, struct oxr_session *sess, struct oxr_action_cache *cache);
86
87
88/*
89 *
90 * Session action functions
91 *
92 */
93
94/*!
95 * Attach action sets from bindInfo to the given session/instance action context.
96 * @public @memberof oxr_session
97 */
98XrResult
99oxr_session_attach_action_sets(struct oxr_logger *log,
100 const struct oxr_interaction_profile_array *suggested_profiles,
101 struct oxr_session_attached_actions *attached_actions,
102 struct oxr_session_action_context *sess_context,
103 const XrSessionActionSetsAttachInfo *bindInfo);
104
105/*!
106 * @public @memberof oxr_session
107 */
108XrResult
109oxr_action_sync_data(struct oxr_logger *log,
110 struct oxr_session *sess,
111 uint32_t countActionSets,
112 const XrActiveActionSet *actionSets,
113 const XrActiveActionSetPrioritiesEXT *activePriorities);
114
115XrResult
117 struct oxr_session *sess,
118 struct oxr_session_action_context *sess_context,
119 uint32_t countActionSets,
120 const XrActiveActionSet *actionSets,
121 const XrActiveActionSetPrioritiesEXT *activePriorities,
122 bool *out_interaction_profile_changed);
123
124/*!
125 * @public @memberof oxr_session
126 */
127XrResult
128oxr_action_enumerate_bound_sources(struct oxr_logger *log,
129 struct oxr_session *sess,
130 uint32_t act_key,
131 uint32_t sourceCapacityInput,
132 uint32_t *sourceCountOutput,
133 XrPath *sources);
134
135
136#ifdef __cplusplus
137}
138#endif
Forward declarations for OpenXR state tracker structs.
XrResult oxr_action_create(struct oxr_logger *log, struct oxr_action_set *act_set, const XrActionCreateInfo *createInfo, struct oxr_action **out_act)
Definition oxr_input.c:455
XrResult oxr_action_sync_data_with_context(struct oxr_logger *log, struct oxr_session *sess, struct oxr_session_action_context *sess_context, uint32_t countActionSets, const XrActiveActionSet *actionSets, const XrActiveActionSetPrioritiesEXT *activePriorities, bool *out_interaction_profile_changed)
Definition oxr_input.c:1968
The set of inputs/outputs for a single sub-action path for an action.
Definition oxr_objects.h:1671
A input action pair of a xrt_input and a xrt_device, along with the required transform.
Definition oxr_objects.h:1632
The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session)...
Definition oxr_objects.h:1574
A group of actions.
Definition oxr_objects.h:1917
A single action.
Definition oxr_objects.h:1990
Holds all action-related state that lives at the instance level (shared across sessions).
Definition oxr_instance_action_context.h:47
Main object that ties everything together.
Definition oxr_objects.h:1196
Manages an array of interaction profiles, does not have a init function but must be zero initialized ...
Definition oxr_interaction_profile_array.h:29
Logger struct that lives on the stack, one for each call client call.
Definition oxr_logger.h:44
This holds all of the action state that belongs on the session level.
Definition oxr_session_action_context.h:62
Per-session map of action key to action attachment.
Definition oxr_session_attached_actions.h:37
Object that client program interact with.
Definition oxr_objects.h:1343
A parsed equivalent of a list of sub-action paths.
Definition oxr_subaction.h:99