Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_instance_action_context.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 per instance action context.
7 * @ingroup oxr_main
8 */
9
10#pragma once
11
14
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20
21/*!
22 * Holds all action-related state that lives at the instance level (shared
23 * across sessions). Used for duplicate checking and storage of client-suggested
24 * that are later applied when action sets are attached to a session.
25 *
26 * - @ref action_sets: Registry of action set name and localized name pairs.
27 * Used to enforce uniqueness in xrCreateActionSet and to remove entries when
28 * an action set is destroyed.
29 * - @ref suggested_profiles: Interaction profile bindings suggested by the app
30 * via xrSuggestInteractionProfileBindings. When the app calls
31 * xrAttachSessionActionSets, this array is cloned into the session’s action
32 * context so the runtime can apply those suggestions for that session.
33 *
34 * In a future extension, this context is intended to support namespaced action
35 * sets and to allow plugins (e.g. in a game) to suggest their own bindings
36 * without affecting the main application’s bindings.
37 *
38 * @ingroup oxr_main
39 */
41{
42 /*!
43 * Action set name and localized name stores.
44 */
45 struct
46 {
47 struct u_hashset *name_store;
48 struct u_hashset *loc_store;
50
51 /*!
52 * Interaction profile bindings that have been suggested by the client.
53 */
55};
56
57
58/*
59 *
60 * Functions
61 *
62 */
63
64/*!
65 * Initialize the action context for an instance.
66 *
67 * @param log Logger
68 * @param context Action context to initialize
69 * @public @memberof oxr_instance_action_context
70 * @ingroup oxr_main
71 */
72XRT_CHECK_RESULT XrResult
73oxr_instance_action_context_init(struct oxr_logger *log, struct oxr_instance_action_context *context);
74
75/*!
76 * Finalize and cleanup the action context for an instance.
77 *
78 * @param context Action context to finalize
79 * @public @memberof oxr_instance_action_context
80 * @ingroup oxr_main
81 */
82void
83oxr_instance_action_context_fini(struct oxr_instance_action_context *context);
84
85
86#ifdef __cplusplus
87}
88#endif
Forward declarations for OpenXR state tracker structs.
Holds interaction profile array related functions.
Holds all action-related state that lives at the instance level (shared across sessions).
Definition oxr_instance_action_context.h:41
struct oxr_instance_action_context::@286 action_sets
Action set name and localized name stores.
struct oxr_interaction_profile_array suggested_profiles
Interaction profile bindings that have been suggested by the client.
Definition oxr_instance_action_context.h:54
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
Kind of bespoke hashset implementation, where the user is responsible for allocating and freeing the ...
Definition u_hashset.cpp:26