Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_binding.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 binding 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 "xrt/xrt_device.h"
15
16#include "oxr_extension_support.h"
18
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24
25/*
26 *
27 * Binding functions
28 *
29 */
30
31/*!
32 * Suggest bindings for an interaction profile. Finds or creates the profile
33 * for the given path, applies the suggested action-path bindings and takes
34 * ownership of the given dpad state.
35 *
36 * @param log Logger
37 * @param store Path store; paths may be created in the store.
38 * @param cache Instance path cache; used to get the profile template.
39 * @param inst_context Instance action context
40 * @param suggestedBindings Suggested bindings for the interaction profile
41 * @param state Dpad state (ownership transferred into the profile)
42 * @return XR_SUCCESS on success
43 * @public @memberof oxr_instance
44 */
45XrResult
46oxr_action_suggest_interaction_profile_bindings(struct oxr_logger *log,
47 struct oxr_path_store *store,
48 const struct oxr_instance_path_cache *cache,
49 struct oxr_instance_action_context *inst_context,
50 const XrInteractionProfileSuggestedBinding *suggestedBindings,
51 struct oxr_dpad_state *state);
52
53/*!
54 * Get the currently active interaction profile for a top-level user path
55 * on the session action context (e.g. /user/hand/left). Requires action sets to
56 * be attached.
57 *
58 * @param log Logger
59 * @param cache Instance path cache
60 * @param action_context Action context
61 * @param topLevelUserPath Top-level user path (e.g. left hand)
62 * @param interactionProfile Output interaction profile state
63 * @return XR_SUCCESS on success
64 * @public @memberof oxr_instance
65 */
66XrResult
67oxr_action_get_current_interaction_profile(struct oxr_logger *log,
68 const struct oxr_instance_path_cache *cache,
69 const struct oxr_session_action_context *action_context,
70 XrPath topLevelUserPath,
71 XrInteractionProfileState *interactionProfile);
72
73/*!
74 * Get input source localized name.
75 *
76 * @param log Logger
77 * @param path_store Needed to look up path strings.
78 * @param action_context Action context
79 * @param getInfo Input source localized name get info
80 * @param bufferCapacityInput Buffer capacity
81 * @param bufferCountOutput Buffer count output
82 * @param buffer Buffer
83 * @return XR_SUCCESS on success
84 * @public @memberof oxr_session
85 */
86XrResult
88 const struct oxr_path_store *store,
89 const struct oxr_session_action_context *action_context,
90 const XrInputSourceLocalizedNameGetInfo *getInfo,
91 uint32_t bufferCapacityInput,
92 uint32_t *bufferCountOutput,
93 char *buffer);
94
95
96#ifdef __cplusplus
97}
98#endif
XrResult oxr_action_get_input_source_localized_name(struct oxr_logger *log, const struct oxr_path_store *store, const struct oxr_session_action_context *action_context, const XrInputSourceLocalizedNameGetInfo *getInfo, uint32_t bufferCapacityInput, uint32_t *bufferCountOutput, char *buffer)
Definition oxr_binding.c:200
Forward declarations for OpenXR state tracker structs.
Holds dpad binding state for a single interaction profile.
Definition oxr_dpad_state.h:83
Holds all action-related state that lives at the instance level (shared across sessions).
Definition oxr_instance_action_context.h:46
This holds cached paths for subaction paths.
Definition oxr_instance_path_cache.h:27
Logger struct that lives on the stack, one for each call client call.
Definition oxr_logger.h:44
Path store structure for managing path storage and lookup.
Definition oxr_path_store.h:31
This holds all of the action state that belongs on the session level.
Definition oxr_session_action_context.h:69
Header defining an xrt display or controller device.