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 * Destroy an interaction profile.
33 *
34 * @param profile Interaction profile to destroy
35 * @public @memberof oxr_interaction_profile
36 */
37void
38oxr_interaction_profile_destroy(struct oxr_interaction_profile *profile);
39
40/*!
41 * Clone an interaction profile.
42 *
43 * @param src_profile Source interaction profile to clone
44 * @return Cloned interaction profile, or NULL if src_profile is NULL
45 * @public @memberof oxr_interaction_profile
46 */
49
50/*!
51 * Find bindings from action key in a profile.
52 *
53 * @param log Logger
54 * @param profile Interaction profile
55 * @param key Action key
56 * @param max_binding_count Maximum number of bindings to return
57 * @param out_bindings Output bindings array
58 * @param out_binding_count Output binding count
59 * @public @memberof oxr_interaction_profile
60 */
61void
63 struct oxr_interaction_profile *profile,
64 uint32_t key,
65 size_t max_binding_count,
66 struct oxr_binding **out_bindings,
67 size_t *out_binding_count);
68
69/*!
70 * @public @memberof oxr_instance
71 */
72XrResult
73oxr_action_suggest_interaction_profile_bindings(struct oxr_logger *log,
74 struct oxr_instance *inst,
75 const XrInteractionProfileSuggestedBinding *suggestedBindings,
76 struct oxr_dpad_state *state);
77
78/*!
79 * @public @memberof oxr_instance
80 */
81XrResult
82oxr_action_get_current_interaction_profile(struct oxr_logger *log,
83 struct oxr_session *sess,
84 XrPath topLevelUserPath,
85 XrInteractionProfileState *interactionProfile);
86
87/*!
88 * @public @memberof oxr_session
89 */
90XrResult
92 struct oxr_session *sess,
93 const XrInputSourceLocalizedNameGetInfo *getInfo,
94 uint32_t bufferCapacityInput,
95 uint32_t *bufferCountOutput,
96 char *buffer);
97
98
99#ifdef __cplusplus
100}
101#endif
XrResult oxr_action_get_input_source_localized_name(struct oxr_logger *log, struct oxr_session *sess, const XrInputSourceLocalizedNameGetInfo *getInfo, uint32_t bufferCapacityInput, uint32_t *bufferCountOutput, char *buffer)
Definition oxr_binding.c:651
void oxr_binding_find_bindings_from_act_key(struct oxr_logger *log, struct oxr_interaction_profile *profile, uint32_t key, size_t max_binding_count, struct oxr_binding **out_bindings, size_t *out_binding_count)
Definition oxr_binding.c:523
Forward declarations for OpenXR state tracker structs.
Interaction profile binding state.
Definition oxr_objects.h:1575
Holds dpad binding state for a single interaction profile.
Definition oxr_dpad_state.h:73
Main object that ties everything together.
Definition oxr_objects.h:1214
A single interaction profile.
Definition oxr_objects.h:1553
struct oxr_interaction_profile * oxr_interaction_profile_clone(const struct oxr_interaction_profile *src_profile)
Clone an interaction profile.
Definition oxr_binding.c:441
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
Header defining an xrt display or controller device.