add ovr platform sdk and test photo sharing
This commit is contained in:
@@ -17,6 +17,13 @@ set_target_properties(
|
||||
${CMAKE_SOURCE_DIR}/../../libs/ovr_mobile/lib/${ANDROID_ABI}/libvrapi.so
|
||||
)
|
||||
|
||||
add_library(ovrplatformloader SHARED IMPORTED)
|
||||
set_target_properties(
|
||||
ovrplatformloader
|
||||
PROPERTIES IMPORTED_LOCATION
|
||||
${CMAKE_SOURCE_DIR}/../../libs/ovr_platform/Android/libs/${ANDROID_ABI}/libovrplatformloader.so
|
||||
)
|
||||
|
||||
|
||||
# Specifies a library name, specifies whether the library is STATIC or
|
||||
# SHARED, and provides relative paths to the source code. You can
|
||||
@@ -121,6 +128,7 @@ add_library(
|
||||
|
||||
target_include_directories(native-lib PRIVATE
|
||||
../../libs/ovr_mobile/include
|
||||
../../libs/ovr_platform/Include
|
||||
src/main/cpp
|
||||
../src/cpp
|
||||
../../src
|
||||
@@ -143,6 +151,7 @@ target_include_directories(native-lib PRIVATE
|
||||
target_link_libraries(
|
||||
native-lib
|
||||
vrapi
|
||||
ovrplatformloader
|
||||
android
|
||||
app-glue
|
||||
${CMAKE_SOURCE_DIR}/../../libs/curl-android-ios/android/${ANDROID_ABI}/libcurl.a
|
||||
|
||||
@@ -69,7 +69,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId = 'com.omixlab.panopainter'
|
||||
minSdkVersion 19
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 26
|
||||
versionCode ver_count
|
||||
versionName "${ver_tag}.${ver_count}"
|
||||
@@ -139,7 +139,7 @@ android {
|
||||
main {
|
||||
manifest.srcFile 'src/main/AndroidManifest.xml'
|
||||
java.srcDirs = ['../src/java', 'src/main/java']
|
||||
jniLibs.srcDirs = ['../../libs/ovr_mobile/lib']
|
||||
jniLibs.srcDirs = ['../../libs/ovr_mobile/lib', '../../libs/ovr_platform/Android/libs']
|
||||
res.srcDirs = ['../src/res']
|
||||
//assets.srcDirs = ['../../assets']
|
||||
}
|
||||
|
||||
@@ -1,28 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.omixlab.panopainter">
|
||||
package="com.omixlab.panopainter"
|
||||
android:installLocation="auto">
|
||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>
|
||||
<uses-feature android:name="android.hardware.vr.headtracking"
|
||||
android:version="1" android:required="false"/>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<application android:label="@string/app_name"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:allowBackup="false"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:allowBackup="false">
|
||||
<meta-data android:name="com.samsung.android.vr.application.mode"
|
||||
android:value="vr_only"/>
|
||||
<activity android:name=".MainActivity"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode"
|
||||
android:screenOrientation="landscape">
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode"
|
||||
android:excludeFromRecents="true"
|
||||
android:screenOrientation="landscape">
|
||||
<meta-data android:name="android.app.lib_name"
|
||||
android:value="native-lib" />
|
||||
android:value="native-lib" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.INFO" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
@@ -91,6 +91,8 @@ void oculus_init(JavaVM* vm, JNIEnv* jni, jobject activity_class)
|
||||
// If intialization failed, vrapi_* function calls will not be available.
|
||||
exit( 0 );
|
||||
}
|
||||
auto result = ovr_PlatformInitializeAndroid("1687982804637910", activity_class, jni);
|
||||
LOG("ovr_PlatformInitializeAndroid result %d", result);
|
||||
}
|
||||
|
||||
void oculus_init_vr(EGLDisplay display, EGLContext context, ANativeWindow* surface)
|
||||
@@ -106,16 +108,17 @@ void oculus_init_vr(EGLDisplay display, EGLContext context, ANativeWindow* surfa
|
||||
for (int i = 0; i < swap_chain_count; i++)
|
||||
{
|
||||
auto texid = vrapi_GetTextureSwapChainHandle(swap_chain[eye], i);
|
||||
if (!ovr_eyes[i][eye].create(rtt_w, rtt_h, texid, GL_RGBA8, true))
|
||||
if (ovr_eyes[i][eye].create(rtt_w, rtt_h, texid, GL_RGBA8, true))
|
||||
{
|
||||
ovr_eyes[i][eye].bindFramebuffer();
|
||||
ovr_eyes[i][eye].clear({1, 0, 1, 1});
|
||||
ovr_eyes[i][eye].unbindFramebuffer();
|
||||
LOG("FAILED create fb for eye %d", eye);
|
||||
ovr_eyes[i][eye].bindTexture();
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
ovr_eyes[i][eye].unbindTexture();
|
||||
LOG("create eye %d", eye);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG("create eye %d", eye);
|
||||
LOG("FAILED create fb for eye %d", eye);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
#include <VrApi_SystemUtils.h>
|
||||
#include <VrApi_Input.h>
|
||||
|
||||
#include <OVR_Platform.h>
|
||||
#include <OVR_PlatformInitialize.h>
|
||||
#include <OVR_Requests_Media.h>
|
||||
#include <OVR_Requests_Livestreaming.h>
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <android/window.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package com.omixlab.panopainter;
|
||||
|
||||
public class Platform {
|
||||
public static final String[] Libs = new String[]{"vrapi"};
|
||||
public static final String[] Libs = new String[]{"vrapi", "ovrplatformloader"};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user