blaind / xrbevy

Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions
64 stars 4 forks source link

Android activity lifecycle #3

Closed blaind closed 3 years ago

blaind commented 3 years ago

Currently the android (Oculus Quest 2) lifecycle has problems. Especially after the initial startup, if user navigates back to the application. Seems like that Oculus may also initialize apps before actually displaying them to user?

Some pointers for investigation:

For running the example, in case of problems current "quick fix" is to just run make run_xr_apk a few times until Oculus kills all remaining instances and launches a new one.

blaind commented 3 years ago

Might need to use separate (activity-based instead of XR events) lifecycle for android. See:

https://developer.oculus.com/downloads/package/oculus-openxr-mobile-sdk/

https://github.com/KhronosGroup/OpenXR-SDK-Source/blob/42b694c4daf3530bf5d66803ef73e189a80c2ef6/src/tests/hello_xr/main.cpp#L156

Ping also @agrande (related to #7)

blaind commented 3 years ago

There was a problem with older version of cargo-apk of silently ignoring the singletask androidmanifest config option.

Fixed in https://github.com/blaind/xrbevy/commit/e99355ab80d50b8fb1fbb5b2f6e7f1e8b6824389. Newest cargo-apk from crates can be used now (cargo install cargo-apk)

Also some changes to lifecycle in https://github.com/blaind/bevy_openxr/commit/0cbefb25876e89bb6b4cf242de0f07bcc72052b9