Skip to content

Commit aad27c8

Browse files
author
Darryl Gough
authored
Add xr::DispatchTable for XrUtility (#104)
* Add xr::DispatchTable for XrUtility Add xr::DispatchTable for XrUtility to support libraries that lazily loads openxr_loader without static link to xrFunctions. Also simplify how to call extension functions through global dispatch table. * Add all XrUtility headers to solutions
1 parent e8089f3 commit aad27c8

44 files changed

Lines changed: 807 additions & 397 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BasicXrApp.sln

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28307.421
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.32228.343
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicXrApp_uwp", "samples\BasicXrApp\BasicXrApp_uwp.vcxproj", "{1B09B21C-2D7A-4278-81C8-84A47D5834A7}"
77
EndProject
88
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicXrApp_win32", "samples\BasicXrApp\BasicXrApp_win32.vcxproj", "{A75A907B-8952-4ED2-BC2D-A68F09CEBD83}"
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "xrUtility", "xrUtility", "{D71728CE-842F-4FA7-94AE-01AEA60BC45A}"
1111
ProjectSection(SolutionItems) = preProject
12+
shared\XrUtility\XrDispatchTable.h = shared\XrUtility\XrDispatchTable.h
13+
shared\XrUtility\XrEnumerate.h = shared\XrUtility\XrEnumerate.h
1214
shared\XrUtility\XrError.h = shared\XrUtility\XrError.h
13-
shared\XrUtility\XrExtensions.h = shared\XrUtility\XrExtensions.h
15+
shared\XrUtility\XrExtensionContext.h = shared\XrUtility\XrExtensionContext.h
16+
shared\XrUtility\XrExtensionDefined.h = shared\XrUtility\XrExtensionDefined.h
17+
shared\XrUtility\XrGuid.h = shared\XrUtility\XrGuid.h
1418
shared\XrUtility\XrHandle.h = shared\XrUtility\XrHandle.h
19+
shared\XrUtility\XrListFunctions.h = shared\XrUtility\XrListFunctions.h
1520
shared\XrUtility\XrMath.h = shared\XrUtility\XrMath.h
21+
shared\XrUtility\XrPlatformDependencies.h = shared\XrUtility\XrPlatformDependencies.h
22+
shared\XrUtility\XrSceneUnderstanding.h = shared\XrUtility\XrSceneUnderstanding.h
23+
shared\XrUtility\XrSceneUnderstanding.hpp = shared\XrUtility\XrSceneUnderstanding.hpp
24+
shared\XrUtility\XrSceneUnderstandingSerialization.hpp = shared\XrUtility\XrSceneUnderstandingSerialization.hpp
25+
shared\XrUtility\XrSide.h = shared\XrUtility\XrSide.h
26+
shared\XrUtility\XrSpatialGraphBridge.h = shared\XrUtility\XrSpatialGraphBridge.h
27+
shared\XrUtility\XrStereoView.h = shared\XrUtility\XrStereoView.h
1628
shared\XrUtility\XrString.h = shared\XrUtility\XrString.h
29+
shared\XrUtility\XrStruct.h = shared\XrUtility\XrStruct.h
30+
shared\XrUtility\XrToString.h = shared\XrUtility\XrToString.h
31+
shared\XrUtility\XrUuid.h = shared\XrUtility\XrUuid.h
32+
shared\XrUtility\XrViewConfiguration.h = shared\XrUtility\XrViewConfiguration.h
1733
EndProjectSection
1834
EndProject
1935
Global

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ over the coming months.
4040

4141
- **The core OpenXR API usage patterns** <br/>
4242
can be found in the [BasicXrApp/OpenXRProgram.cpp](https://github.com/microsoft/OpenXR-MixedReality/blob/main/samples/BasicXrApp/OpenXrProgram.cpp) file.
43-
The [Run() function](https://github.com/microsoft/OpenXR-MixedReality/blob/main/samples/BasicXrApp/OpenXrProgram.cpp#L15)
43+
The [Run() function](https://github.com/microsoft/OpenXR-MixedReality/blob/main/samples/BasicXrApp/OpenXrProgram.cpp#L28)
4444
captures a typical OpenXR app code flow for session initialization, event handling, the frame loop and input actions.
4545

4646
- **Hand tracking** <br/>

Samples.sln

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,30 @@ EndProject
3232
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XrUtility", "XrUtility", "{AF0F6DD8-1BC3-4818-919E-9B239B544B5E}"
3333
ProjectSection(SolutionItems) = preProject
3434
shared\XrUtility\XrActionContext.h = shared\XrUtility\XrActionContext.h
35+
shared\XrUtility\XrDispatchTable.h = shared\XrUtility\XrDispatchTable.h
3536
shared\XrUtility\XrEnumerate.h = shared\XrUtility\XrEnumerate.h
3637
shared\XrUtility\XrError.h = shared\XrUtility\XrError.h
3738
shared\XrUtility\XrExtensionContext.h = shared\XrUtility\XrExtensionContext.h
38-
shared\XrUtility\XrExtensions.h = shared\XrUtility\XrExtensions.h
39+
shared\XrUtility\XrExtensionDefined.h = shared\XrUtility\XrExtensionDefined.h
40+
shared\XrUtility\XrGuid.h = shared\XrUtility\XrGuid.h
3941
shared\XrUtility\XrHandle.h = shared\XrUtility\XrHandle.h
4042
shared\XrUtility\XrInstanceContext.h = shared\XrUtility\XrInstanceContext.h
43+
shared\XrUtility\XrListFunctions.h = shared\XrUtility\XrListFunctions.h
4144
shared\XrUtility\XrMath.h = shared\XrUtility\XrMath.h
45+
shared\XrUtility\XrPlatformDependencies.h = shared\XrUtility\XrPlatformDependencies.h
4246
shared\XrUtility\XrSceneUnderstanding.h = shared\XrUtility\XrSceneUnderstanding.h
4347
shared\XrUtility\XrSceneUnderstanding.hpp = shared\XrUtility\XrSceneUnderstanding.hpp
4448
shared\XrUtility\XrSceneUnderstandingSerialization.h = shared\XrUtility\XrSceneUnderstandingSerialization.h
49+
shared\XrUtility\XrSceneUnderstandingSerialization.hpp = shared\XrUtility\XrSceneUnderstandingSerialization.hpp
4550
shared\XrUtility\XrSessionContext.h = shared\XrUtility\XrSessionContext.h
4651
shared\XrUtility\XrSide.h = shared\XrUtility\XrSide.h
52+
shared\XrUtility\XrSpatialGraphBridge.h = shared\XrUtility\XrSpatialGraphBridge.h
4753
shared\XrUtility\XrStereoView.h = shared\XrUtility\XrStereoView.h
4854
shared\XrUtility\XrString.h = shared\XrUtility\XrString.h
4955
shared\XrUtility\XrStruct.h = shared\XrUtility\XrStruct.h
5056
shared\XrUtility\XrSystemContext.h = shared\XrUtility\XrSystemContext.h
5157
shared\XrUtility\XrToString.h = shared\XrUtility\XrToString.h
58+
shared\XrUtility\XrUuid.h = shared\XrUtility\XrUuid.h
5259
shared\XrUtility\XrViewConfiguration.h = shared\XrUtility\XrViewConfiguration.h
5360
EndProjectSection
5461
EndProject

samples/BasicXrApp/OpenXrProgram.cpp

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ namespace {
5858

5959
createInfo.applicationInfo = {"BasicXrApp", 1, "", 1, XR_CURRENT_API_VERSION};
6060
strcpy_s(createInfo.applicationInfo.applicationName, m_applicationName.c_str());
61-
CHECK_XRCMD(xrCreateInstance(&createInfo, m_instance.Put()));
61+
CHECK_XRCMD(xrCreateInstance(&createInfo, m_instance.Put(xrDestroyInstance)));
6262

63-
m_extensions.PopulateDispatchTable(m_instance.Get());
63+
xr::g_dispatchTable.Initialize(m_instance.Get(), xrGetInstanceProcAddr);
6464
}
6565

6666
std::vector<const char*> SelectExtensions() {
@@ -109,7 +109,7 @@ namespace {
109109
XrActionSetCreateInfo actionSetInfo{XR_TYPE_ACTION_SET_CREATE_INFO};
110110
strcpy_s(actionSetInfo.actionSetName, "place_hologram_action_set");
111111
strcpy_s(actionSetInfo.localizedActionSetName, "Placement");
112-
CHECK_XRCMD(xrCreateActionSet(m_instance.Get(), &actionSetInfo, m_actionSet.Put()));
112+
CHECK_XRCMD(xrCreateActionSet(m_instance.Get(), &actionSetInfo, m_actionSet.Put(xrDestroyActionSet)));
113113
}
114114

115115
// Create actions.
@@ -126,7 +126,7 @@ namespace {
126126
strcpy_s(actionInfo.localizedActionName, "Place Hologram");
127127
actionInfo.countSubactionPaths = (uint32_t)m_subactionPaths.size();
128128
actionInfo.subactionPaths = m_subactionPaths.data();
129-
CHECK_XRCMD(xrCreateAction(m_actionSet.Get(), &actionInfo, m_placeAction.Put()));
129+
CHECK_XRCMD(xrCreateAction(m_actionSet.Get(), &actionInfo, m_placeAction.Put(xrDestroyAction)));
130130
}
131131

132132
// Create an input action getting the left and right hand poses.
@@ -137,7 +137,7 @@ namespace {
137137
strcpy_s(actionInfo.localizedActionName, "Hand Pose");
138138
actionInfo.countSubactionPaths = (uint32_t)m_subactionPaths.size();
139139
actionInfo.subactionPaths = m_subactionPaths.data();
140-
CHECK_XRCMD(xrCreateAction(m_actionSet.Get(), &actionInfo, m_poseAction.Put()));
140+
CHECK_XRCMD(xrCreateAction(m_actionSet.Get(), &actionInfo, m_poseAction.Put(xrDestroyAction)));
141141
}
142142

143143
// Create an output action for vibrating the left and right controller.
@@ -148,7 +148,7 @@ namespace {
148148
strcpy_s(actionInfo.localizedActionName, "Vibrate");
149149
actionInfo.countSubactionPaths = (uint32_t)m_subactionPaths.size();
150150
actionInfo.subactionPaths = m_subactionPaths.data();
151-
CHECK_XRCMD(xrCreateAction(m_actionSet.Get(), &actionInfo, m_vibrateAction.Put()));
151+
CHECK_XRCMD(xrCreateAction(m_actionSet.Get(), &actionInfo, m_vibrateAction.Put(xrDestroyAction)));
152152
}
153153

154154
// Create an input action to exit the session.
@@ -159,7 +159,7 @@ namespace {
159159
strcpy_s(actionInfo.localizedActionName, "Exit session");
160160
actionInfo.countSubactionPaths = (uint32_t)m_subactionPaths.size();
161161
actionInfo.subactionPaths = m_subactionPaths.data();
162-
CHECK_XRCMD(xrCreateAction(m_actionSet.Get(), &actionInfo, m_exitAction.Put()));
162+
CHECK_XRCMD(xrCreateAction(m_actionSet.Get(), &actionInfo, m_exitAction.Put(xrDestroyAction)));
163163
}
164164
}
165165

@@ -183,8 +183,7 @@ namespace {
183183
}
184184

185185
// Set up suggested bindings for the hp/mixed_reality_controller profile.
186-
if (m_optionalExtensions.HPMRControllerSupported)
187-
{
186+
if (m_optionalExtensions.HPMRControllerSupported) {
188187
std::vector<XrActionSuggestedBinding> bindings;
189188
bindings.push_back({m_placeAction.Get(), GetXrPath("/user/hand/right/input/trigger/value")});
190189
bindings.push_back({m_placeAction.Get(), GetXrPath("/user/hand/left/input/trigger/value")});
@@ -203,8 +202,7 @@ namespace {
203202
}
204203

205204
// Set up suggested bindings for the microsoft/hand_interaction profile.
206-
if (m_optionalExtensions.MsftHandInteractionSupported)
207-
{
205+
if (m_optionalExtensions.MsftHandInteractionSupported) {
208206
std::vector<XrActionSuggestedBinding> bindings;
209207
bindings.push_back({m_placeAction.Get(), GetXrPath("/user/hand/right/input/select/value")});
210208
bindings.push_back({m_placeAction.Get(), GetXrPath("/user/hand/left/input/select/value")});
@@ -267,7 +265,7 @@ namespace {
267265

268266
// Create the D3D11 device for the adapter associated with the system.
269267
XrGraphicsRequirementsD3D11KHR graphicsRequirements{XR_TYPE_GRAPHICS_REQUIREMENTS_D3D11_KHR};
270-
CHECK_XRCMD(m_extensions.xrGetD3D11GraphicsRequirementsKHR(m_instance.Get(), m_systemId, &graphicsRequirements));
268+
CHECK_XRCMD(xrGetD3D11GraphicsRequirementsKHR(m_instance.Get(), m_systemId, &graphicsRequirements));
271269

272270
// Create a list of feature levels which are both supported by the OpenXR runtime and this application.
273271
std::vector<D3D_FEATURE_LEVEL> featureLevels = {D3D_FEATURE_LEVEL_12_1,
@@ -290,7 +288,7 @@ namespace {
290288
XrSessionCreateInfo createInfo{XR_TYPE_SESSION_CREATE_INFO};
291289
createInfo.next = &graphicsBinding;
292290
createInfo.systemId = m_systemId;
293-
CHECK_XRCMD(xrCreateSession(m_instance.Get(), &createInfo, m_session.Put()));
291+
CHECK_XRCMD(xrCreateSession(m_instance.Get(), &createInfo, m_session.Put(xrDestroySession)));
294292

295293
XrSessionActionSetsAttachInfo attachInfo{XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO};
296294
std::vector<XrActionSet> actionSets = {m_actionSet.Get()};
@@ -318,7 +316,7 @@ namespace {
318316
XrReferenceSpaceCreateInfo spaceCreateInfo{XR_TYPE_REFERENCE_SPACE_CREATE_INFO};
319317
spaceCreateInfo.referenceSpaceType = m_appSpaceType;
320318
spaceCreateInfo.poseInReferenceSpace = xr::math::Pose::Identity();
321-
CHECK_XRCMD(xrCreateReferenceSpace(m_session.Get(), &spaceCreateInfo, m_appSpace.Put()));
319+
CHECK_XRCMD(xrCreateReferenceSpace(m_session.Get(), &spaceCreateInfo, m_appSpace.Put(xrDestroySpace)));
322320
}
323321

324322
// Create a space for each hand pointer pose.
@@ -327,7 +325,7 @@ namespace {
327325
createInfo.action = m_poseAction.Get();
328326
createInfo.poseInActionSpace = xr::math::Pose::Identity();
329327
createInfo.subactionPath = m_subactionPaths[side];
330-
CHECK_XRCMD(xrCreateActionSpace(m_session.Get(), &createInfo, m_cubesInHand[side].Space.Put()));
328+
CHECK_XRCMD(xrCreateActionSpace(m_session.Get(), &createInfo, m_cubesInHand[side].Space.Put(xrDestroySpace)));
331329
}
332330
}
333331

@@ -450,7 +448,7 @@ namespace {
450448
swapchainCreateInfo.createFlags = createFlags;
451449
swapchainCreateInfo.usageFlags = usageFlags;
452450

453-
CHECK_XRCMD(xrCreateSwapchain(session, &swapchainCreateInfo, swapchain.Handle.Put()));
451+
CHECK_XRCMD(xrCreateSwapchain(session, &swapchainCreateInfo, swapchain.Handle.Put(xrDestroySwapchain)));
454452

455453
uint32_t chainLength;
456454
CHECK_XRCMD(xrEnumerateSwapchainImages(swapchain.Handle.Get(), 0, &chainLength, nullptr));
@@ -535,13 +533,12 @@ namespace {
535533
createInfo.pose = poseInAppSpace;
536534
createInfo.time = placementTime;
537535

538-
XrResult result = m_extensions.xrCreateSpatialAnchorMSFT(
539-
m_session.Get(), &createInfo, hologram.Anchor.Put(m_extensions.xrDestroySpatialAnchorMSFT));
536+
XrResult result = xrCreateSpatialAnchorMSFT(m_session.Get(), &createInfo, hologram.Anchor.Put(xrDestroySpatialAnchorMSFT));
540537
if (XR_SUCCEEDED(result)) {
541538
XrSpatialAnchorSpaceCreateInfoMSFT createSpaceInfo{XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT};
542539
createSpaceInfo.anchor = hologram.Anchor.Get();
543540
createSpaceInfo.poseInAnchorSpace = xr::math::Pose::Identity();
544-
CHECK_XRCMD(m_extensions.xrCreateSpatialAnchorSpaceMSFT(m_session.Get(), &createSpaceInfo, hologram.Cube.Space.Put()));
541+
CHECK_XRCMD(xrCreateSpatialAnchorSpaceMSFT(m_session.Get(), &createSpaceInfo, hologram.Cube.Space.Put(xrDestroySpace)));
545542
} else if (result == XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT) {
546543
DEBUG_PRINT("Anchor cannot be created, likely due to lost positional tracking.");
547544
} else {
@@ -553,7 +550,7 @@ namespace {
553550
XrReferenceSpaceCreateInfo createInfo{XR_TYPE_REFERENCE_SPACE_CREATE_INFO};
554551
createInfo.referenceSpaceType = m_appSpaceType;
555552
createInfo.poseInReferenceSpace = poseInAppSpace;
556-
CHECK_XRCMD(xrCreateReferenceSpace(m_session.Get(), &createInfo, hologram.Cube.Space.Put()));
553+
CHECK_XRCMD(xrCreateReferenceSpace(m_session.Get(), &createInfo, hologram.Cube.Space.Put(xrDestroySpace)));
557554
}
558555
return hologram;
559556
}
@@ -707,7 +704,7 @@ namespace {
707704
XrReferenceSpaceCreateInfo createInfo{XR_TYPE_REFERENCE_SPACE_CREATE_INFO};
708705
createInfo.referenceSpaceType = referenceSpaceType;
709706
createInfo.poseInReferenceSpace = poseInReferenceSpace;
710-
CHECK_XRCMD(xrCreateReferenceSpace(session, &createInfo, space.Put()));
707+
CHECK_XRCMD(xrCreateReferenceSpace(session, &createInfo, space.Put(xrDestroySpace)));
711708
return space;
712709
};
713710

@@ -890,7 +887,6 @@ namespace {
890887
xr::InstanceHandle m_instance;
891888
xr::SessionHandle m_session;
892889
uint64_t m_systemId{XR_NULL_SYSTEM_ID};
893-
xr::ExtensionDispatchTable m_extensions;
894890

895891
struct {
896892
bool DepthExtensionSupported{false};

samples/BasicXrApp/pch.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@
2626
#define XR_USE_GRAPHICS_API_D3D11
2727
#include <openxr/openxr.h>
2828
#include <openxr/openxr_platform.h>
29+
#include <openxr/openxr_reflection.h>
2930

31+
#define ENABLE_GLOBAL_XR_DISPATCH_TABLE
32+
#include <XrUtility/XrDispatchTable.h>
3033
#include <XrUtility/XrError.h>
3134
#include <XrUtility/XrHandle.h>
3235
#include <XrUtility/XrMath.h>
3336
#include <XrUtility/XrString.h>
34-
#include <XrUtility/XrExtensions.h>
3537

3638
#include <winrt/base.h> // winrt::com_ptr

samples/EyeGazeInteractionUwp/Scene_EyeGazeInteraction.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ namespace {
3030

3131
struct EyeGazeInteractionScene : public engine::Scene {
3232
EyeGazeInteractionScene(engine::Context& context)
33-
: Scene(context) {
34-
const bool supportsEyeGazeAction =
35-
context.Extensions.SupportsEyeGazeInteraction && context.System.EyeGazeInteractionProperties.supportsEyeGazeInteraction;
36-
if (supportsEyeGazeAction) {
33+
: Scene(context)
34+
, m_supportsEyeGazeAction(context.Extensions.SupportsEyeGazeInteraction &&
35+
context.System.EyeGazeInteractionProperties.supportsEyeGazeInteraction) {
36+
if (m_supportsEyeGazeAction) {
3737
sample::ActionSet& actionSet =
3838
ActionContext().CreateActionSet("eye_gaze_interaction_scene_actions", "Eye Gaze Interaction Scene Actions");
3939

@@ -47,13 +47,13 @@ namespace {
4747
XrActionSpaceCreateInfo createInfo{XR_TYPE_ACTION_SPACE_CREATE_INFO};
4848
createInfo.action = gazeAction;
4949
createInfo.poseInActionSpace = Pose::Identity();
50-
CHECK_XRCMD(xrCreateActionSpace(m_context.Session.Handle, &createInfo, m_gazeSpace.Put()));
50+
CHECK_XRCMD(xrCreateActionSpace(m_context.Session.Handle, &createInfo, m_gazeSpace.Put(xrDestroySpace)));
5151
} else {
5252
// Use VIEW reference space to simulate eye gaze when the system doesn't support
5353
XrReferenceSpaceCreateInfo createInfo{XR_TYPE_REFERENCE_SPACE_CREATE_INFO};
5454
createInfo.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_VIEW;
5555
createInfo.poseInReferenceSpace = Pose::Identity();
56-
CHECK_XRCMD(xrCreateReferenceSpace(m_context.Session.Handle, &createInfo, m_gazeSpace.Put()));
56+
CHECK_XRCMD(xrCreateReferenceSpace(m_context.Session.Handle, &createInfo, m_gazeSpace.Put(xrDestroySpace)));
5757
}
5858

5959
m_gazeObject = AddObject(engine::CreateObject());
@@ -83,6 +83,17 @@ namespace {
8383
XrSpaceLocation location{XR_TYPE_SPACE_LOCATION};
8484
CHECK_XRCMD(xrLocateSpace(m_gazeSpace.Get(), m_context.AppSpace, frameTime.PredictedDisplayTime, &location));
8585

86+
// eye gaze sample time validation
87+
if (m_supportsEyeGazeAction) {
88+
XrEyeGazeSampleTimeEXT eyeGazeSampleTime{XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT};
89+
XrSpaceLocation testLocation{XR_TYPE_SPACE_LOCATION, &eyeGazeSampleTime};
90+
CHECK_XRCMD(xrLocateSpace(m_gazeSpace.Get(), m_context.AppSpace, frameTime.PredictedDisplayTime, &testLocation));
91+
CHECK_XRCMD(xrLocateSpace(m_context.AppSpace, m_gazeSpace.Get(), frameTime.PredictedDisplayTime, &testLocation));
92+
CHECK_XRCMD(xrLocateSpace(m_gazeSpace.Get(), m_gazeSpace.Get(), frameTime.PredictedDisplayTime, &testLocation));
93+
assert(XR_ERROR_VALIDATION_FAILURE ==
94+
xrLocateSpace(m_context.AppSpace, m_context.AppSpace, frameTime.PredictedDisplayTime, &testLocation));
95+
}
96+
8697
if (Pose::IsPoseValid(location)) {
8798
m_gazeObject->SetVisible(true);
8899
m_gazeObject->Pose() = location.pose;
@@ -100,6 +111,7 @@ namespace {
100111
}
101112

102113
private:
114+
const bool m_supportsEyeGazeAction{false};
103115
xr::SpaceHandle m_gazeSpace;
104116
std::shared_ptr<engine::Object> m_gazeObject;
105117
std::shared_ptr<engine::Object> m_gazeLookAtAxis;

samples/EyeGazeInteractionUwp/pch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
#define XR_USE_GRAPHICS_API_D3D11
3131
#include <openxr/openxr.h>
3232
#include <openxr/openxr_platform.h>
33+
#include <openxr/openxr_reflection.h>
3334

35+
#define ENABLE_GLOBAL_XR_DISPATCH_TABLE
36+
#include <XrUtility/XrDispatchTable.h>
3437
#include <XrUtility/XrError.h>
3538
#include <XrUtility/XrMath.h>
3639
#include <SampleShared/Trace.h>

samples/SampleSceneUwp/Main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ namespace {
3838
appConfig.RequestedExtensions.push_back(XR_MSFT_SPATIAL_ANCHOR_EXTENSION_NAME);
3939
appConfig.RequestedExtensions.push_back(XR_MSFT_HAND_INTERACTION_EXTENSION_NAME);
4040
appConfig.RequestedExtensions.push_back(XR_EXT_HAND_TRACKING_EXTENSION_NAME);
41+
appConfig.RequestedExtensions.push_back(XR_EXT_HAND_JOINTS_MOTION_RANGE_EXTENSION_NAME);
4142
appConfig.RequestedExtensions.push_back(XR_MSFT_HAND_TRACKING_MESH_EXTENSION_NAME);
4243

4344
// NOTE: Uncomment a filter below to test specific action binding of given profile.

0 commit comments

Comments
 (0)