mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 08:00:25 +02:00
Added Android Meta Quest Support
This commit is contained in:
1 parent
49b8602543
commit
e52227baf5
67 files changed
+5662
-176
No files matched your search
@@ -0,0 +1,41 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(MKW_ENABLE_OPENXR) && defined(__ANDROID__)
|
||||
|
||||
#include "vr/openxr_runtime.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace mkw::vr {
|
||||
|
||||
// Android-specific OpenXR bootstrap.
|
||||
//
|
||||
// The Khronos loader on Android must be told which JavaVM and Context it lives
|
||||
// in before any other OpenXR entry point is called (xrInitializeLoaderKHR), and
|
||||
// xrCreateInstance must chain an XrInstanceCreateInfoAndroidKHR naming the
|
||||
// activity. Both come from SDL's Android glue (the SDLActivity that hosts the
|
||||
// runtime), so no extra JNI surface is needed. DolphinXR found that the loader
|
||||
// context must be the *activity*, not the application context: with a plain
|
||||
// application context the Quest runtime never leaves XR_SESSION_STATE_IDLE.
|
||||
//
|
||||
// Call order: OpenXRAndroidInitializeLoader() once, before OpenXRRuntime::Initialize;
|
||||
// then pass OpenXRAndroidInstanceCreateNext() as OpenXRConfig::instance_create_next.
|
||||
bool OpenXRAndroidInitializeLoader(OpenXRLogCallback logger, std::string* error);
|
||||
const void* OpenXRAndroidInstanceCreateNext();
|
||||
|
||||
// Optional XR_KHR_android_thread_settings hint for the calling thread. Failure
|
||||
// is not an error: some Quest runtime builds advertise the extension but reject
|
||||
// particular thread types, so the caller only logs the outcome.
|
||||
enum class OpenXRAndroidThreadType {
|
||||
ApplicationMain,
|
||||
ApplicationWorker,
|
||||
RendererMain,
|
||||
RendererWorker,
|
||||
};
|
||||
bool OpenXRAndroidRegisterThread(OpenXRRuntime& runtime, OpenXRAndroidThreadType type);
|
||||
|
||||
} // namespace mkw::vr
|
||||
|
||||
#endif // defined(MKW_ENABLE_OPENXR) && defined(__ANDROID__)
|
||||
Reference in new issue
Block a user