1、下載openxr示例代碼
https://github.com/KhronosGroup/OpenXR-SDK-Source.git
mkdir build\win64
cd build\win64
cmake -G "Visual Studio [Version Number] Win64" ....
cmake -G "Visual Studio 17" ../..
cmake -G "Visual Studio 17" -A x64 ../..
然后用VS打開build\win64\OPENXR.sln 工程
2、編譯會生成可執(zhí)行文件
C:\Work\github\OpenXR-SDK-Source\build\win64\src\tests\hello_xr\Debug\hello_xr.exe
執(zhí)行 C:\Work\github\OpenXR-SDK-Source\build\win64\src\tests\hello_xr\Debug\hello_xr.exe -g Vulkan
會提示找不到runtime

image.png
3、安裝微軟的運行時 https://www.khronos.org/openxr/

image.png

image.png
4、安裝成功界面

image.png
重新運行不會出現(xiàn)運行時報錯了

image.png
但是缺擴展

image.png
5、安裝模擬器
hololens模擬器:
https://docs.microsoft.com/zh-cn/windows/mixed-reality/develop/install-the-tools

image.png
Windows Mixed Reality 模擬器:
使用 Windows Mixed Reality 模擬器 - Mixed Reality | Microsoft Docs

image.png
6、我們打開頭戴模擬 這個時候再看擴展終于出來了

image.png
7、我們的helloxr終于可以在windows模擬器上運行起來了

105287473378785054.png