The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: Add function to get the space from a oxr_space

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2626>

authored by

Jakob Bornecrantz and committed by
Marge Bot
23558880 6f8c75ef

+31
+13
src/xrt/state_trackers/oxr/oxr_objects.h
··· 984 984 XrTime time, 985 985 struct xrt_space_relation *out_relation); 986 986 987 + /*! 988 + * Get the xrt_space associated with this oxr_space, the @ref xrt_space will 989 + * be reference counted by this function so the caller will need to call 990 + * @ref xrt_space_reference to decrement the reference count. 991 + * 992 + * @param log Logging struct. 993 + * @param spc Oxr space to get the xrt_space from. 994 + * @param[out] out_xspace Returns the xrt_space associated with this oxr_space. 995 + * @return Any errors, XR_SUCCESS, xspace is not set on XR_ERROR_*. 996 + */ 997 + XRT_CHECK_RESULT XrResult 998 + oxr_space_get_xrt_space(struct oxr_logger *log, struct oxr_space *spc, struct xrt_space **out_xspace); 999 + 987 1000 988 1001 /* 989 1002 *
+18
src/xrt/state_trackers/oxr/oxr_space.c
··· 1 1 // Copyright 2019-2024, Collabora, Ltd. 2 + // Copyright 2025, NVIDIA CORPORATION. 2 3 // SPDX-License-Identifier: BSL-1.0 3 4 /*! 4 5 * @file ··· 612 613 613 614 return ret; 614 615 } 616 + 617 + XrResult 618 + oxr_space_get_xrt_space(struct oxr_logger *log, struct oxr_space *spc, struct xrt_space **out_xspace) 619 + { 620 + assert(out_xspace != NULL); 621 + assert(*out_xspace == NULL); 622 + 623 + struct xrt_space *xspace = NULL; 624 + XrResult ret = get_xrt_space(log, spc, &xspace); 625 + if (ret != XR_SUCCESS) { 626 + return ret; 627 + } 628 + 629 + xrt_space_reference(out_xspace, xspace); 630 + 631 + return XR_SUCCESS; 632 + }