I keep getting unresolved external symbol on xrCreateSpatialGraphNodeSpaceMSFT and at this point I just ran out of things I could try to make this thing work. I wouldn't call myself an experienced programmer by any means so I guess it is very possible I'm just doing something very stupid. I'll be very thankful for any kind of response.
I've tried using headers from the NuGet package and the ones on Microsoft/OpenXR-MixedReality.
As for loader, I've tried the NuGet package one and building one myself from KhronosGroup/OpenXR-SDK.
I didn't have any luck with any of these (again, that might be because I did something wrong or juts plain stupid..).
Here's the code just for reference.
xr::SpaceHandle target_space{};
XrSpatialGraphNodeSpaceCreateInfoMSFT* create_info{};
create_info->type = XR_TYPE_SPATIAL_GRAPH_NODE_SPACE_CREATE_INFO_MSFT;
guid_ g_data{ code };
create_info->nodeType = XR_SPATIAL_GRAPH_NODE_TYPE_STATIC_MSFT;
memcpy(create_info->nodeId, (void*)g_data.Data1, sizeof(guid_));
xrCreateSpatialGraphNodeSpaceMSFT(m_session.Get(), create_info, target_space.Put());
xrCreateSpatialGraphNodeSpaceMSFT
is not a core OpenXR function (as indicated by the MSFT
suffix). You must first retrieve a function pointer to it, as explained here.
Also, be sure that the corresponding extension (XR_MSFT_spatial_graph_bridge) is enabled when creating the OpenXR instance, as described here.
Finally, please note that there is also a bug in your code snippet: your create_info
struct is declared as a pointer, but never allocated. Better just declare it as a local allocated on the stack.