Files
android-activity/examples/na-openxr-info
Robert Bragg 649b65c0c0 Update examples
- Updates deps
- Some README updates considering the Winit backend based on
  android-activity has been merged upstream
- runs cargo fmt over examples
- Top-level Cargo.toml simply excludes "examples" instead of
  listing each sub-directory separately
2022-11-10 19:28:01 +00:00
..
2022-08-26 17:27:03 +01:00
2022-08-26 17:27:03 +01:00
2022-08-31 20:44:14 +01:00
2022-08-26 17:27:03 +01:00
2022-08-31 20:44:14 +01:00
2022-11-10 19:28:01 +00:00
2022-08-26 17:27:03 +01:00
2022-08-26 17:27:03 +01:00
2022-08-26 17:27:03 +01:00
2022-08-31 20:44:14 +01:00

This is a minimal OpenXR application that builds for desktop or Android and simply prints out extension information for the OpenXR library.

This is based on the hello example from the openxrs repo.

Oculus Quest

To build for the Oculus Quest then you first need to download the Oculus OpenXR Mobile SDK from: https://developer.oculus.com/downloads/package/oculus-openxr-mobile-sdk/

and after unpacking the zip file you need to copy a suitable libopenxr_loader.so library to app/src/main/jniLibs/<abi>

For example if building for arm64-v8a: cp path/to/ovr_openxr_mobile_sdk_42.0/OpenXR/Libs/Android/arm64-v8a/Debug/libopenxr_loader.so app/src/main/jniLibs/arm64-v8a

export ANDROID_NDK_HOME="path/to/ndk"
export ANDROID_HOME="path/to/sdk"

rustup target add aarch64-linux-android
cargo install cargo-ndk

cargo ndk -t arm64-v8a -o app/src/main/jniLibs/ build
./gradlew build
./gradlew installDebug

Oculus Quest: Vulkan Validation Layer

To enable the Vulkan validation layer on the Oculus Quest run:

adb shell setprop debug.oculus.loadandinjectpackagedvvl.co.realfit.naopenxrwgpu 1

Desktop

To build for PC you need to build with the "desktop" feature

cargo run --features=desktop