From dffeb683c92b6ab2fbbf240817e4087a134d997f Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 19 Feb 2025 10:13:36 +0100 Subject: [PATCH 09/11] st/oxr: bind to dynamic role's profile --- src/xrt/state_trackers/oxr/oxr_binding.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/xrt/state_trackers/oxr/oxr_binding.c b/src/xrt/state_trackers/oxr/oxr_binding.c index 07378d7b3..83a7b241d 100644 --- a/src/xrt/state_trackers/oxr/oxr_binding.c +++ b/src/xrt/state_trackers/oxr/oxr_binding.c @@ -380,6 +380,23 @@ oxr_find_profile_for_device(struct oxr_logger *log, return; } + // Have bindings for the dynamic role's profile been suggested? +#define FIND_PROFILE(X) \ + { \ + struct xrt_device *role_xdev = GET_XDEV_BY_ROLE(sess->sys, X); \ + if (role_xdev == xdev) { \ + enum xrt_device_name profile = GET_PROFILE_NAME_BY_ROLE(sess->sys, X); \ + oxr_get_profile_for_device_name(log, sess, profile, out_p); \ + if (*out_p != NULL) { \ + return; \ + } \ + } \ + } + FIND_PROFILE(left); + FIND_PROFILE(right); + FIND_PROFILE(gamepad); +#undef FIND_PROFILE + // Have bindings for this device's interaction profile been suggested? oxr_get_profile_for_device_name(log, sess, xdev->name, out_p); if (*out_p != NULL) { -- 2.49.0