Forum Discussion
JackSu0717
2 years agoHonored Guest
Compile OpenXR SDK to .so file for Android Application
hello everyone, I want to make an Android application that run on Oculus Quest 2, the App need to get the key event and headset event. So I want to compile OpenXR SDK to .so file so that my android a...
JackSu0717
2 years agoHonored Guest
my code is :
std::shared_ptr<Options> options = std::make_shared<Options>();
if (!UpdateOptionsFromSystemProperties(*options)) {
return 1;
}
std::shared_ptr<PlatformData> data = std::make_shared<PlatformData>();
data->applicationVM = context.Vm;
data->applicationActivity = context.ActivityObject;
bool requestRestart = false;
bool exitRenderLoop = false;
// Create platform-specific implementation.
std::shared_ptr<IPlatformPlugin> platformPlugin = CreatePlatformPlugin(options, data);
// Create graphics API implementation.
std::shared_ptr<IGraphicsPlugin> graphicsPlugin = CreateGraphicsPlugin(options, platformPlugin);
// Initialize the OpenXR program.
std::shared_ptr<IOpenXrProgram> program = CreateOpenXrProgram(options, platformPlugin, graphicsPlugin);
// Initialize the loader for this platform
PFN_xrInitializeLoaderKHR initializeLoader = nullptr;
if (XR_SUCCEEDED(
xrGetInstanceProcAddr(XR_NULL_HANDLE, "xrInitializeLoaderKHR", (PFN_xrVoidFunction*)(&initializeLoader)))) {
XrLoaderInitInfoAndroidKHR loaderInitInfoAndroid = {XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR};
loaderInitInfoAndroid.applicationVM = context.Vm;
loaderInitInfoAndroid.applicationContext = context.ActivityObject;
initializeLoader((const XrLoaderInitInfoBaseHeaderKHR*)&loaderInitInfoAndroid);
}
LOGI("Create instance");
program->CreateInstance();when run to CreateInstance()
void CreateInstance() override {
LogLayersAndExtensions();
CreateInstanceInternal();
LogInstanceInfo();
}when run in the LogLayersAndExtensions() Func , it show the error like this :
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 11 months ago
- 9 months ago
- 2 years agoAnonymous