fix android
This commit is contained in:
@@ -40,6 +40,10 @@ openxr = { git = "https://github.com/Ralith/openxrs", rev = "0177d2d", features
|
|||||||
"static",
|
"static",
|
||||||
] }
|
] }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "android")'.dependencies]
|
||||||
|
ndk-context = "0.1"
|
||||||
|
jni = "0.20"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
bevy = "0.12"
|
bevy = "0.12"
|
||||||
color-eyre = "0.6.2"
|
color-eyre = "0.6.2"
|
||||||
|
|||||||
@@ -395,6 +395,13 @@ pub fn end_frame(
|
|||||||
environment_blend_mode: Res<XrEnvironmentBlendMode>,
|
environment_blend_mode: Res<XrEnvironmentBlendMode>,
|
||||||
// passthrough_layer: Option<Res<XrPassthroughLayer>>,
|
// passthrough_layer: Option<Res<XrPassthroughLayer>>,
|
||||||
) {
|
) {
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
{
|
||||||
|
let ctx = ndk_context::android_context();
|
||||||
|
let vm = unsafe { jni::JavaVM::from_raw(ctx.vm().cast()) }.unwrap();
|
||||||
|
let env = vm.attach_current_thread_as_daemon();
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let _span = info_span!("xr_release_image").entered();
|
let _span = info_span!("xr_release_image").entered();
|
||||||
swapchain.release_image().unwrap();
|
swapchain.release_image().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user