41 lines
2.0 KiB
Diff
41 lines
2.0 KiB
Diff
From e92fb94901fc652bde712af1e90c14237ea26f8f Mon Sep 17 00:00:00 2001
|
|
From: Patrick Nicolas <patricknicolas@laposte.net>
|
|
Date: Wed, 19 Feb 2025 10:13:36 +0100
|
|
Subject: [PATCH 08/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 ce4c0cca1..8ba94dc55 100644
|
|
--- a/src/xrt/state_trackers/oxr/oxr_binding.c
|
|
+++ b/src/xrt/state_trackers/oxr/oxr_binding.c
|
|
@@ -488,6 +488,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
|
|
|