mirror of https://github.com/bjornbytes/lovr.git
Cleanup;
This commit is contained in:
parent
bd03180d44
commit
bf31072d0d
|
@ -760,16 +760,18 @@ elseif(ANDROID)
|
||||||
|
|
||||||
if(LOVR_USE_OPENXR)
|
if(LOVR_USE_OPENXR)
|
||||||
add_custom_command(TARGET move_files POST_BUILD
|
add_custom_command(TARGET move_files POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
$<TARGET_SONAME_FILE:${LOVR_OPENXR}>
|
$<TARGET_SONAME_FILE:${LOVR_OPENXR}>
|
||||||
raw/lib/${ANDROID_ABI}/libopenxr_loader_generic.so
|
raw/lib/${ANDROID_ABI}/libopenxr_loader_generic.so
|
||||||
)
|
)
|
||||||
set (PICO_LOADER "${CMAKE_CURRENT_SOURCE_DIR}/deps/pico-openxr/libs/android.${ANDROID_ABI}/libopenxr_loader.so")
|
|
||||||
if (EXISTS ${PICO_LOADER})
|
set(PICO_LOADER "${CMAKE_CURRENT_SOURCE_DIR}/deps/pico-openxr/libs/android.${ANDROID_ABI}/libopenxr_loader.so")
|
||||||
|
if(EXISTS ${PICO_LOADER})
|
||||||
configure_file(${PICO_LOADER} "raw/lib/${ANDROID_ABI}/libopenxr_loader_pico.so" COPYONLY)
|
configure_file(${PICO_LOADER} "raw/lib/${ANDROID_ABI}/libopenxr_loader_pico.so" COPYONLY)
|
||||||
endif()
|
endif()
|
||||||
set (OCULUS_LOADER "${CMAKE_CURRENT_SOURCE_DIR}/deps/oculus-openxr/Libs/Android/${ANDROID_ABI}/Release/libopenxr_loader.so")
|
|
||||||
if (EXISTS ${OCULUS_LOADER})
|
set(OCULUS_LOADER "${CMAKE_CURRENT_SOURCE_DIR}/deps/oculus-openxr/Libs/Android/${ANDROID_ABI}/Release/libopenxr_loader.so")
|
||||||
|
if(EXISTS ${OCULUS_LOADER})
|
||||||
configure_file(${OCULUS_LOADER} "raw/lib/${ANDROID_ABI}/libopenxr_loader_oculus.so" COPYONLY)
|
configure_file(${OCULUS_LOADER} "raw/lib/${ANDROID_ABI}/libopenxr_loader_oculus.so" COPYONLY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -11,13 +11,10 @@ public class Activity extends NativeActivity {
|
||||||
if (Build.MANUFACTURER.contains("Oculus")) {
|
if (Build.MANUFACTURER.contains("Oculus")) {
|
||||||
Log.d("LOVR", "Using Oculus OpenXR Loader");
|
Log.d("LOVR", "Using Oculus OpenXR Loader");
|
||||||
System.loadLibrary("openxr_loader_oculus");
|
System.loadLibrary("openxr_loader_oculus");
|
||||||
}
|
} else if (Build.MANUFACTURER.contains("Pico")) {
|
||||||
else if (Build.MANUFACTURER.contains("Pico"))
|
|
||||||
{
|
|
||||||
Log.d("LOVR", "Using Pico OpenXR Loader");
|
Log.d("LOVR", "Using Pico OpenXR Loader");
|
||||||
System.loadLibrary("openxr_loader_pico");
|
System.loadLibrary("openxr_loader_pico");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Log.d("LOVR", "Using Generic OpenXR Loader");
|
Log.d("LOVR", "Using Generic OpenXR Loader");
|
||||||
System.loadLibrary("openxr_loader_generic");
|
System.loadLibrary("openxr_loader_generic");
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,16 +10,16 @@
|
||||||
<uses-permission android:name="com.oculus.permission.HAND_TRACKING"/>
|
<uses-permission android:name="com.oculus.permission.HAND_TRACKING"/>
|
||||||
<uses-permission android:name="com.oculus.permission.TRACKED_KEYBOARD"/>
|
<uses-permission android:name="com.oculus.permission.TRACKED_KEYBOARD"/>
|
||||||
<uses-permission android:name="com.oculus.permission.RENDER_MODEL"/>
|
<uses-permission android:name="com.oculus.permission.RENDER_MODEL"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
|
||||||
<!-- Khronos/Generic -->
|
<!-- Khronos/Generic -->
|
||||||
<uses-permission android:name="org.khronos.openxr.permission.OPENXR" />
|
<uses-permission android:name="org.khronos.openxr.permission.OPENXR"/>
|
||||||
<uses-permission android:name="org.khronos.openxr.permission.OPENXR_SYSTEM" />
|
<uses-permission android:name="org.khronos.openxr.permission.OPENXR_SYSTEM"/>
|
||||||
<queries>
|
<queries>
|
||||||
<provider android:name="org.khronos.openxr.runtime_broker" android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" />
|
<provider android:name="org.khronos.openxr.runtime_broker" android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker"/>
|
||||||
</queries>
|
</queries>
|
||||||
|
|
||||||
<application android:allowBackup="false" android:label="LÖVR" android:extractNativeLibs="false" android:debuggable="true">
|
<application android:allowBackup="false" android:label="LÖVR" android:extractNativeLibs="false" android:debuggable="true">
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="com.oculus.intent.category.VR"/>
|
<category android:name="com.oculus.intent.category.VR"/>
|
||||||
<category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />
|
<category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
|
@ -361,7 +361,7 @@ static bool openxr_init(HeadsetConfig* config) {
|
||||||
free(extensionProperties);
|
free(extensionProperties);
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
XrInstanceCreateInfoAndroidKHR infoAndroid = {
|
XrInstanceCreateInfoAndroidKHR androidInfo = {
|
||||||
.type = XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR,
|
.type = XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR,
|
||||||
.applicationVM = os_get_java_vm(),
|
.applicationVM = os_get_java_vm(),
|
||||||
.applicationActivity = os_get_jni_context(),
|
.applicationActivity = os_get_jni_context(),
|
||||||
|
@ -372,7 +372,7 @@ static bool openxr_init(HeadsetConfig* config) {
|
||||||
XrInstanceCreateInfo info = {
|
XrInstanceCreateInfo info = {
|
||||||
.type = XR_TYPE_INSTANCE_CREATE_INFO,
|
.type = XR_TYPE_INSTANCE_CREATE_INFO,
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
.next = &infoAndroid,
|
.next = &androidInfo,
|
||||||
#endif
|
#endif
|
||||||
.applicationInfo.engineName = "LÖVR",
|
.applicationInfo.engineName = "LÖVR",
|
||||||
.applicationInfo.engineVersion = (LOVR_VERSION_MAJOR << 24) + (LOVR_VERSION_MINOR << 16) + LOVR_VERSION_PATCH,
|
.applicationInfo.engineVersion = (LOVR_VERSION_MAJOR << 24) + (LOVR_VERSION_MINOR << 16) + LOVR_VERSION_PATCH,
|
||||||
|
@ -380,7 +380,7 @@ static bool openxr_init(HeadsetConfig* config) {
|
||||||
.applicationInfo.applicationVersion = 0,
|
.applicationInfo.applicationVersion = 0,
|
||||||
.applicationInfo.apiVersion = XR_CURRENT_API_VERSION,
|
.applicationInfo.apiVersion = XR_CURRENT_API_VERSION,
|
||||||
.enabledExtensionCount = enabledExtensionCount,
|
.enabledExtensionCount = enabledExtensionCount,
|
||||||
.enabledExtensionNames = enabledExtensionNames,
|
.enabledExtensionNames = enabledExtensionNames
|
||||||
};
|
};
|
||||||
|
|
||||||
XR_INIT(xrCreateInstance(&info, &state.instance));
|
XR_INIT(xrCreateInstance(&info, &state.instance));
|
||||||
|
@ -578,7 +578,7 @@ static bool openxr_init(HeadsetConfig* config) {
|
||||||
[PROFILE_WMR] = "/interaction_profiles/microsoft/motion_controller",
|
[PROFILE_WMR] = "/interaction_profiles/microsoft/motion_controller",
|
||||||
[PROFILE_TRACKER] = "/interaction_profiles/htc/vive_tracker_htcx",
|
[PROFILE_TRACKER] = "/interaction_profiles/htc/vive_tracker_htcx",
|
||||||
[PROFILE_GAZE] = "/interaction_profiles/ext/eye_gaze_interaction",
|
[PROFILE_GAZE] = "/interaction_profiles/ext/eye_gaze_interaction",
|
||||||
[PROFILE_PICO] = "/interaction_profiles/pico/neo3_controller",
|
[PROFILE_PICO] = "/interaction_profiles/pico/neo3_controller"
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -828,7 +828,6 @@ static bool openxr_init(HeadsetConfig* config) {
|
||||||
bindings[PROFILE_GAZE][0].path = NULL;
|
bindings[PROFILE_GAZE][0].path = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int successProfiles = -1;
|
|
||||||
XrPath path;
|
XrPath path;
|
||||||
XrActionSuggestedBinding suggestedBindings[64];
|
XrActionSuggestedBinding suggestedBindings[64];
|
||||||
for (uint32_t i = 0, count = 0; i < MAX_PROFILES; i++, count = 0) {
|
for (uint32_t i = 0, count = 0; i < MAX_PROFILES; i++, count = 0) {
|
||||||
|
@ -840,15 +839,17 @@ static bool openxr_init(HeadsetConfig* config) {
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
XR_INIT(xrStringToPath(state.instance, interactionProfilePaths[i], &path));
|
XR_INIT(xrStringToPath(state.instance, interactionProfilePaths[i], &path));
|
||||||
int res = (xrSuggestInteractionProfileBindings(state.instance, &(XrInteractionProfileSuggestedBinding) {
|
XrResult result = (xrSuggestInteractionProfileBindings(state.instance, &(XrInteractionProfileSuggestedBinding) {
|
||||||
.type = XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING,
|
.type = XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING,
|
||||||
.interactionProfile = path,
|
.interactionProfile = path,
|
||||||
.countSuggestedBindings = count,
|
.countSuggestedBindings = count,
|
||||||
.suggestedBindings = suggestedBindings
|
.suggestedBindings = suggestedBindings
|
||||||
}));
|
}));
|
||||||
if (XR_SUCCEEDED(res)) successProfiles++;
|
|
||||||
|
if (XR_FAILED(result)) {
|
||||||
|
lovrLog(LOG_WARN, "XR", "Failed to suggest input bindings for %s", interactionProfilePaths[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
XR_INIT(successProfiles);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue