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#include "oxr_pair_hashset.h"
15#include "oxr_refcounted.h"
16
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23/*!
24 * Holds all action-related state that lives at the instance level (shared
25 * across sessions). Used for duplicate checking and storage of client-suggested
26 * that are later applied when action sets are attached to a session.
27 *
28 * Reference-counted; use @ref oxr_refcounted_ref and @ref oxr_refcounted_unref
29 * on the @ref base member to manage references. Destroy is only called when
30 * the reference count reaches zero.
31 *
32 * - @ref action_sets: Registry of action set name and localized name pairs.
33 * Used to enforce uniqueness in xrCreateActionSet and to remove entries when
34 * an action set is destroyed.
35 * - @ref suggested_profiles: Interaction profile bindings suggested by the app
36 * via xrSuggestInteractionProfileBindings. When the app calls
37 * xrAttachSessionActionSets, this array is cloned into the session’s action
38 * context so the runtime can apply those suggestions for that session.
39 *
40 * In a future extension, this context is intended to support namespaced action
41 * sets and to allow plugins (e.g. in a game) to suggest their own bindings
42 * without affecting the main application’s bindings.
43 *
44 * @ingroup oxr_main
45 */
47{
48 struct oxr_refcounted base;
49
50 /*!
51 * Action set name and localized name stores.
52 */
54
55 /*!
56 * Interaction profile bindings that have been suggested by the client.
57 */
59};
60
61
62/*
63 *
64 * Functions
65 *
66 */
67
68/*!
69 * Create a new instance action context (reference count 1).
70 *
71 * @param log Logger
72 * @param out_context On success, the new context (refcount 1). Caller must
73 * call @ref oxr_refcounted_unref on context->base when done.
74 * @public @memberof oxr_instance_action_context
75 * @ingroup oxr_main
76 */
77XRT_CHECK_RESULT XrResult
78oxr_instance_action_context_create(struct oxr_logger *log, struct oxr_instance_action_context **out_context);
79
80
81#ifdef __cplusplus
82}
83#endif
Forward declarations for OpenXR state tracker structs.
Holds interaction profile array related functions.
Pair of name/localized hashets with atomic erase helper.
Reference-counted base for OpenXR state tracker objects.
Holds all action-related state that lives at the instance level (shared across sessions).
Definition oxr_instance_action_context.h:47
struct oxr_interaction_profile_array suggested_profiles
Interaction profile bindings that have been suggested by the client.
Definition oxr_instance_action_context.h:58
struct oxr_pair_hashset action_sets
Action set name and localized name stores.
Definition oxr_instance_action_context.h:53
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
A pair of hashets (name_store and loc_store) with an optional mutex so that both members can be remov...
Definition oxr_pair_hashset.h:36
Definition oxr_refcounted.h:21