add oculus quest build target
29
android/src/main/cpp/main.cpp → android/src/cpp/main.cpp
Executable file → Normal 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
@@ -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>
|
||||
0
android/src/main/res/mipmap-hdpi/ic_launcher.png → android/src/res/mipmap-hdpi/ic_launcher.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
0
android/src/main/res/mipmap-mdpi/ic_launcher.png → android/src/res/mipmap-mdpi/ic_launcher.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
0
android/src/main/res/mipmap-xhdpi/ic_launcher.png → android/src/res/mipmap-xhdpi/ic_launcher.png
Executable file → Normal file
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
0
android/src/main/res/mipmap-xxhdpi/ic_launcher.png → android/src/res/mipmap-xxhdpi/ic_launcher.png
Executable file → Normal file
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
0
android/src/main/res/mipmap-xxxhdpi/ic_launcher.png → android/src/res/mipmap-xxxhdpi/ic_launcher.png
Executable file → Normal file
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |