add ovr platform sdk and test photo sharing
This commit is contained in:
@@ -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