add oculus quest build target

This commit is contained in:
2019-05-27 18:14:35 +02:00
parent e7f8839739
commit 9d6bb0187e
38 changed files with 920 additions and 239 deletions

View File

@@ -24,6 +24,13 @@
#include <cassert>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <android/window.h>
#include <sys/prctl.h> // for prctl( PR_SET_NAME )
#include "VrApi.h"
#include "VrApi_Helpers.h"
#include "VrApi_SystemUtils.h"
#include "VrApi_Input.h"
#include "pch.h"
#include "app.h"
@@ -1040,6 +1047,28 @@ void android_main(struct android_app* state) {
state->onInputEvent = engine_handle_input;
g_engine.app = state;
// BEGIN OVR
ANativeActivity_setWindowFlags(state->activity, AWINDOW_FLAG_KEEP_SCREEN_ON, 0 );
ovrJava java;
java.Vm = state->activity->vm;
(*java.Vm).AttachCurrentThread(&java.Env, NULL );
java.ActivityObject = state->activity->clazz;
// Note that AttachCurrentThread will reset the thread name.
prctl( PR_SET_NAME, (long)"OVR::Main", 0, 0, 0 );
const ovrInitParms initParms = vrapi_DefaultInitParms( &java );
int32_t initResult = vrapi_Initialize( &initParms );
if ( initResult != VRAPI_INITIALIZE_SUCCESS )
{
// If intialization failed, vrapi_* function calls will not be available.
exit( 0 );
}
// END OVR
// Prepare to monitor accelerometer
/*
g_engine.sensorManager = ASensorManager_getInstance();

0
android/src/main/cpp/main.h → android/src/cpp/main.h Executable file → Normal file
View File

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.omixlab.panopainter">
<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"/>
<application android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="fullUser"
android:windowSoftInputMode="adjustResize">
<meta-data android:name="android.app.lib_name"
android:value="native-lib" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB