~bl4ckb0ne/wxrc

73c3f7dbf3a9302de801a90f215c7dc931fd052c — Simon Zeni 1 year, 3 months ago e9a191f
wxrc/xrutil: add wxrc_xr_has_hand_tracking function
2 files changed, 24 insertions(+), 0 deletions(-)

M wxrc/xrutil.c
M wxrc/xrutil.h
M wxrc/xrutil.c => wxrc/xrutil.c +22 -0
@@ 440,3 440,25 @@ wxrc_xr_load_func(XrInstance instance, const char *name)

	return pfn;
}

bool
wxrc_xr_has_hand_tracking(XrInstance instance, XrSystemId system_id)
{
	XrSystemHandTrackingPropertiesEXT hand_tracking_props = {
		.type = XR_TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT,
		.next = NULL,
	};

	XrSystemProperties props = {
		.type = XR_TYPE_SYSTEM_PROPERTIES,
		.next = &hand_tracking_props,
	};

	XrResult r = xrGetSystemProperties(instance, system_id, &props);
	if (XR_FAILED(r)) {
		wxrc_xr_log(r, "failed to get system properties");
		return false;
	}

	return hand_tracking_props.supportsHandTracking;
}

M wxrc/xrutil.h => wxrc/xrutil.h +2 -0
@@ 53,4 53,6 @@ bool wxrc_xr_location_tracked(XrSpaceLocationFlags flag);

PFN_xrVoidFunction wxrc_xr_load_func(XrInstance instance, const char *name);

bool wxrc_xr_has_hand_tracking(XrInstance instance, XrSystemId system_id);

#endif