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

@@ -1,141 +0,0 @@
# Sets the minimum version of CMake required to build your native library.
# This ensures that a certain set of CMake features is available to
# your build.
cmake_minimum_required(VERSION 3.4.1)
# build native_app_glue as a static lib
add_library(
app-glue STATIC
../libs/native_app_glue/android_native_app_glue.c
)
# Specifies a library name, specifies whether the library is STATIC or
# SHARED, and provides relative paths to the source code. You can
# define multiple libraries by adding multiple add.library() commands,
# and CMake builds them for you. When you build your app, Gradle
# automatically packages shared libraries with your APK.
# now build app's shared lib
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
add_library(
native-lib SHARED
../libs/yoga/yoga/log.cpp
../libs/yoga/yoga/Utils.cpp
../libs/yoga/yoga/YGConfig.cpp
../libs/yoga/yoga/YGEnums.cpp
../libs/yoga/yoga/YGLayout.cpp
../libs/yoga/yoga/YGMarker.cpp
../libs/yoga/yoga/YGNode.cpp
../libs/yoga/yoga/YGNodePrint.cpp
../libs/yoga/yoga/YGStyle.cpp
../libs/yoga/yoga/YGValue.cpp
../libs/yoga/yoga/Yoga.cpp
../libs/tinyxml2/tinyxml2.cpp
../libs/jpeg/jpgd.cpp
../libs/jpeg/jpge.cpp
../libs/poly2tri/poly2tri/common/shapes.cc
../libs/poly2tri/poly2tri/sweep/advancing_front.cc
../libs/poly2tri/poly2tri/sweep/cdt.cc
../libs/poly2tri/poly2tri/sweep/sweep_context.cc
../libs/poly2tri/poly2tri/sweep/sweep.cc
../libs/fmt/src/format.cc
src/main/cpp/main.cpp
../src/pch.cpp
../src/util.cpp
../src/rtt.cpp
../src/bezier.cpp
../src/asset.cpp
../src/image.cpp
../src/texture.cpp
../src/font.cpp
../src/shader.cpp
../src/shape.cpp
../src/app.cpp
../src/app_cloud.cpp
../src/app_dialogs.cpp
../src/app_events.cpp
../src/app_layout.cpp
../src/app_shaders.cpp
../src/app_vr.cpp
../src/brush.cpp
../src/canvas.cpp
../src/canvas_modes.cpp
../src/log.cpp
../src/action.cpp
../src/layout.cpp
../src/version.cpp
../src/node.cpp
../src/node_about.cpp
../src/node_border.cpp
../src/node_button.cpp
../src/node_button_custom.cpp
../src/node_canvas.cpp
../src/node_checkbox.cpp
../src/node_color_quad.cpp
../src/node_colorwheel.cpp
../src/node_combobox.cpp
../src/node_changelog.cpp
../src/node_dialog_browse.cpp
../src/node_dialog_cloud.cpp
../src/node_dialog_open.cpp
../src/node_dialog_picker.cpp
../src/node_dialog_layer_rename.cpp
../src/node_dialog_resize.cpp
../src/node_icon.cpp
../src/node_image.cpp
../src/node_image_texture.cpp
../src/node_message_box.cpp
../src/node_panel_brush.cpp
../src/node_panel_color.cpp
../src/node_panel_grid.cpp
../src/node_panel_floating.cpp
../src/node_panel_layer.cpp
../src/node_panel_stroke.cpp
../src/node_panel_quick.cpp
../src/node_popup_menu.cpp
../src/node_progress_bar.cpp
../src/node_settings.cpp
../src/node_slider.cpp
../src/node_stroke_preview.cpp
../src/node_text.cpp
../src/node_text_input.cpp
../src/node_usermanual.cpp
../src/node_viewport.cpp
../src/node_scroll.cpp
../src/abr.cpp
../src/binary_stream.cpp
../src/serializer.cpp
../src/settings.cpp
)
target_include_directories(native-lib PRIVATE
src/main/cpp
../src
../libs/glm
../libs/tinyxml2
../libs/yoga
../libs/stb
../libs/jpeg
../libs/curl-android-ios/android/include
../libs/poly2tri/poly2tri
../libs/base64
../libs/sqlite3
../libs/nanort
../libs/native_app_glue
../libs/hash-library
../libs/fmt/include
)
# add lib dependencies
target_link_libraries(
native-lib
android
app-glue
${CMAKE_SOURCE_DIR}/../libs/curl-android-ios/android/${ANDROID_ABI}/libcurl.a
EGL
GLESv3
log
z
)

View File

@@ -0,0 +1,141 @@
# Sets the minimum version of CMake required to build your native library.
# This ensures that a certain set of CMake features is available to
# your build.
cmake_minimum_required(VERSION 3.4.1)
# build native_app_glue as a static lib
add_library(
app-glue STATIC
../../libs/native_app_glue/android_native_app_glue.c
)
# Specifies a library name, specifies whether the library is STATIC or
# SHARED, and provides relative paths to the source code. You can
# define multiple libraries by adding multiple add.library() commands,
# and CMake builds them for you. When you build your app, Gradle
# automatically packages shared libraries with your APK.
# now build app's shared lib
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
add_library(
native-lib SHARED
../../libs/yoga/yoga/log.cpp
../../libs/yoga/yoga/Utils.cpp
../../libs/yoga/yoga/YGConfig.cpp
../../libs/yoga/yoga/YGEnums.cpp
../../libs/yoga/yoga/YGLayout.cpp
../../libs/yoga/yoga/YGMarker.cpp
../../libs/yoga/yoga/YGNode.cpp
../../libs/yoga/yoga/YGNodePrint.cpp
../../libs/yoga/yoga/YGStyle.cpp
../../libs/yoga/yoga/YGValue.cpp
../../libs/yoga/yoga/Yoga.cpp
../../libs/tinyxml2/tinyxml2.cpp
../../libs/jpeg/jpgd.cpp
../../libs/jpeg/jpge.cpp
../../libs/poly2tri/poly2tri/common/shapes.cc
../../libs/poly2tri/poly2tri/sweep/advancing_front.cc
../../libs/poly2tri/poly2tri/sweep/cdt.cc
../../libs/poly2tri/poly2tri/sweep/sweep_context.cc
../../libs/poly2tri/poly2tri/sweep/sweep.cc
../../libs/fmt/src/format.cc
../src/cpp/main.cpp
../../src/pch.cpp
../../src/util.cpp
../../src/rtt.cpp
../../src/bezier.cpp
../../src/asset.cpp
../../src/image.cpp
../../src/texture.cpp
../../src/font.cpp
../../src/shader.cpp
../../src/shape.cpp
../../src/app.cpp
../../src/app_cloud.cpp
../../src/app_dialogs.cpp
../../src/app_events.cpp
../../src/app_layout.cpp
../../src/app_shaders.cpp
../../src/app_vr.cpp
../../src/brush.cpp
../../src/canvas.cpp
../../src/canvas_modes.cpp
../../src/log.cpp
../../src/action.cpp
../../src/layout.cpp
../../src/version.cpp
../../src/node.cpp
../../src/node_about.cpp
../../src/node_border.cpp
../../src/node_button.cpp
../../src/node_button_custom.cpp
../../src/node_canvas.cpp
../../src/node_checkbox.cpp
../../src/node_color_quad.cpp
../../src/node_colorwheel.cpp
../../src/node_combobox.cpp
../../src/node_changelog.cpp
../../src/node_dialog_browse.cpp
../../src/node_dialog_cloud.cpp
../../src/node_dialog_open.cpp
../../src/node_dialog_picker.cpp
../../src/node_dialog_layer_rename.cpp
../../src/node_dialog_resize.cpp
../../src/node_icon.cpp
../../src/node_image.cpp
../../src/node_image_texture.cpp
../../src/node_message_box.cpp
../../src/node_panel_brush.cpp
../../src/node_panel_color.cpp
../../src/node_panel_grid.cpp
../../src/node_panel_floating.cpp
../../src/node_panel_layer.cpp
../../src/node_panel_stroke.cpp
../../src/node_panel_quick.cpp
../../src/node_popup_menu.cpp
../../src/node_progress_bar.cpp
../../src/node_settings.cpp
../../src/node_slider.cpp
../../src/node_stroke_preview.cpp
../../src/node_text.cpp
../../src/node_text_input.cpp
../../src/node_usermanual.cpp
../../src/node_viewport.cpp
../../src/node_scroll.cpp
../../src/abr.cpp
../../src/binary_stream.cpp
../../src/serializer.cpp
../../src/settings.cpp
)
target_include_directories(native-lib PRIVATE
../src/cpp
../../src
../../libs/glm
../../libs/tinyxml2
../../libs/yoga
../../libs/stb
../../libs/jpeg
../../libs/curl-android-ios/android/include
../../libs/poly2tri/poly2tri
../../libs/base64
../../libs/sqlite3
../../libs/nanort
../../libs/native_app_glue
../../libs/hash-library
../../libs/fmt/include
)
# add lib dependencies
target_link_libraries(
native-lib
android
app-glue
${CMAKE_SOURCE_DIR}/../../libs/curl-android-ios/android/${ANDROID_ABI}/libcurl.a
EGL
GLESv3
log
z
)

View File

@@ -134,16 +134,27 @@ android {
path "CMakeLists.txt"
}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['../src/java']
//jniLibs.srcDir 'libs'
res.srcDirs = ['../src/res']
//assets.srcDirs = ['../../assets']
}
}
}
task copyFiles(type: Copy) {
from '../data/'
from '../../data/'
into 'src/main/assets/data'
}
preBuild.dependsOn(copyFiles)
task generateVersioning(type: Exec) {
workingDir "$projectDir/../"
workingDir "$projectDir/../../"
commandLine 'python', 'scripts/pre-build.py', flavor
}
copyFiles.dependsOn(generateVersioning)

0
android/gradlew → android/android/gradlew vendored Executable file → Normal file
View File

View File

@@ -1,90 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -0,0 +1,9 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon Oct 08 14:04:19 CEST 2018
ndk.dir=C\:\\Users\\omar\\AppData\\Local\\Android\\Sdk\\ndk-bundle
sdk.dir=C\:\\Users\\omar\\AppData\\Local\\Android\\Sdk

View File

@@ -0,0 +1,148 @@
# Sets the minimum version of CMake required to build your native library.
# This ensures that a certain set of CMake features is available to
# your build.
cmake_minimum_required(VERSION 3.4.1)
# build native_app_glue as a static lib
add_library(
app-glue STATIC
../../libs/native_app_glue/android_native_app_glue.c
)
add_library(vrapi SHARED IMPORTED)
set_target_properties(vrapi PROPERTIES IMPORTED_LOCATION
C:/ovr_sdk_mobile_1.23/VrApi/Libs/Android/${ANDROID_ABI}/Release/libvrapi.so)
# Specifies a library name, specifies whether the library is STATIC or
# SHARED, and provides relative paths to the source code. You can
# define multiple libraries by adding multiple add.library() commands,
# and CMake builds them for you. When you build your app, Gradle
# automatically packages shared libraries with your APK.
# now build app's shared lib
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
add_library(
native-lib SHARED
../../libs/yoga/yoga/log.cpp
../../libs/yoga/yoga/Utils.cpp
../../libs/yoga/yoga/YGConfig.cpp
../../libs/yoga/yoga/YGEnums.cpp
../../libs/yoga/yoga/YGLayout.cpp
../../libs/yoga/yoga/YGMarker.cpp
../../libs/yoga/yoga/YGNode.cpp
../../libs/yoga/yoga/YGNodePrint.cpp
../../libs/yoga/yoga/YGStyle.cpp
../../libs/yoga/yoga/YGValue.cpp
../../libs/yoga/yoga/Yoga.cpp
../../libs/tinyxml2/tinyxml2.cpp
../../libs/jpeg/jpgd.cpp
../../libs/jpeg/jpge.cpp
../../libs/poly2tri/poly2tri/common/shapes.cc
../../libs/poly2tri/poly2tri/sweep/advancing_front.cc
../../libs/poly2tri/poly2tri/sweep/cdt.cc
../../libs/poly2tri/poly2tri/sweep/sweep_context.cc
../../libs/poly2tri/poly2tri/sweep/sweep.cc
../../libs/fmt/src/format.cc
../src/cpp/main.cpp
../../src/pch.cpp
../../src/util.cpp
../../src/rtt.cpp
../../src/bezier.cpp
../../src/asset.cpp
../../src/image.cpp
../../src/texture.cpp
../../src/font.cpp
../../src/shader.cpp
../../src/shape.cpp
../../src/app.cpp
../../src/app_cloud.cpp
../../src/app_dialogs.cpp
../../src/app_events.cpp
../../src/app_layout.cpp
../../src/app_shaders.cpp
../../src/app_vr.cpp
../../src/brush.cpp
../../src/canvas.cpp
../../src/canvas_modes.cpp
../../src/log.cpp
../../src/action.cpp
../../src/layout.cpp
../../src/version.cpp
../../src/node.cpp
../../src/node_about.cpp
../../src/node_border.cpp
../../src/node_button.cpp
../../src/node_button_custom.cpp
../../src/node_canvas.cpp
../../src/node_checkbox.cpp
../../src/node_color_quad.cpp
../../src/node_colorwheel.cpp
../../src/node_combobox.cpp
../../src/node_changelog.cpp
../../src/node_dialog_browse.cpp
../../src/node_dialog_cloud.cpp
../../src/node_dialog_open.cpp
../../src/node_dialog_picker.cpp
../../src/node_dialog_layer_rename.cpp
../../src/node_dialog_resize.cpp
../../src/node_icon.cpp
../../src/node_image.cpp
../../src/node_image_texture.cpp
../../src/node_message_box.cpp
../../src/node_panel_brush.cpp
../../src/node_panel_color.cpp
../../src/node_panel_grid.cpp
../../src/node_panel_floating.cpp
../../src/node_panel_layer.cpp
../../src/node_panel_stroke.cpp
../../src/node_panel_quick.cpp
../../src/node_popup_menu.cpp
../../src/node_progress_bar.cpp
../../src/node_settings.cpp
../../src/node_slider.cpp
../../src/node_stroke_preview.cpp
../../src/node_text.cpp
../../src/node_text_input.cpp
../../src/node_usermanual.cpp
../../src/node_viewport.cpp
../../src/node_scroll.cpp
../../src/abr.cpp
../../src/binary_stream.cpp
../../src/serializer.cpp
../../src/settings.cpp
)
target_include_directories(native-lib PRIVATE
C:/ovr_sdk_mobile_1.23/VrApi/Include
../src/cpp
../../src
../../libs/glm
../../libs/tinyxml2
../../libs/yoga
../../libs/stb
../../libs/jpeg
../../libs/curl-android-ios/android/include
../../libs/poly2tri/poly2tri
../../libs/base64
../../libs/sqlite3
../../libs/nanort
../../libs/native_app_glue
../../libs/hash-library
../../libs/fmt/include
)
# add lib dependencies
target_link_libraries(
native-lib
vrapi
android
app-glue
${CMAKE_SOURCE_DIR}/../../libs/curl-android-ios/android/${ANDROID_ABI}/libcurl.a
EGL
GLESv3
log
z
)

View File

@@ -0,0 +1,4 @@
xcopy /I /D /Y /S /E ..\data src\main\assets\data
call gradlew installDebug
call adb shell am start -n com.omigamedev/android.app.NativeActivity
pause

179
android/quest/build.gradle Normal file
View File

@@ -0,0 +1,179 @@
import java.util.regex.Matcher
import java.util.regex.Pattern
buildscript {
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "gradle.plugin.com.gladed.gradle.androidgitversion:gradle-android-git-version:0.4.5"
}
}
allprojects {
repositories {
google() // and here
jcenter()
}
}
apply plugin: "com.android.application"
apply plugin: "com.gladed.androidgitversion"
def getCurrentFlavor() {
Gradle gradle = getGradle()
if (gradle.getStartParameter().getTaskRequests().args.size() == 0)
return ""
String tskReqStr = gradle.getStartParameter().getTaskRequests().args[0][0]
Pattern pattern
pattern = Pattern.compile("(\\w*)(Release|Debug)")
Matcher matcher = pattern.matcher( tskReqStr )
if( matcher.find() )
return matcher.group(2).toLowerCase()
else
{
println "NO MATCH FOUND"
return ""
}
}
def flavor = getCurrentFlavor()
def flavor_cap = getCurrentFlavor().capitalize()
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def sdkDir = properties.getProperty("sdk.dir")
def classpath = "build/intermediates/javac/${flavor}/compile${flavor_cap}JavaWithJavac/classes;${sdkDir}/platforms/android-26/android.jar"
def activity = "com.omixlab.panopainter.MainActivity"
def outpath = "src/main/cpp"
def ver_branch = "git rev-parse --abbrev-ref HEAD".execute().text.trim()
def ver_hash = "git log --pretty=format:%h -n 1".execute().text.trim()
def ver_count = Integer.parseInt("git rev-list --count HEAD".execute().text.trim())
def ver_tag = "git describe --tags --abbrev=0".execute().text.trim()
println classpath
android {
compileSdkVersion 26
android.buildToolsVersion "28.0.3"
defaultConfig {
applicationId = 'com.omixlab.panopainter'
minSdkVersion 19
targetSdkVersion 26
versionCode ver_count
versionName "${ver_tag}.${ver_count}"
// This block is different from the one you use to link Gradle
// to your CMake or ndk-build script.
externalNativeBuild {
// For ndk-build, instead use the ndkBuild block
cmake {
// Passes optional arguments to CMake.
//arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang"
// Sets optional flags for the C compiler.
//cFlags "-D_EXAMPLE_C_FLAG1", "-D_EXAMPLE_C_FLAG2"
// Sets a flag to enable format macro constants for the C++ compiler.
//cppFlags "-D__STDC_FORMAT_MACROS"
arguments "-DANDROID_TOOLCHAIN=clang",
//"-DANDROID_PLATFORM=android-19",
"-DANDROID_STL=c++_shared",
"-DCMAKE_BUILD_TYPE=${flavor_cap}",
"-DANDROID_ARM_NEON=TRUE"
}
}
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
// abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a'
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
// productFlavors {
// main {
// externalNativeBuild {
// cmake {
// targets "native-lib-demo"
// }
// }
// }
// }
signingConfigs {
release {
storeFile file("ppkey.jks")
storePassword "om4r@Pano#Painter_2018"
keyAlias "PanoPainter"
keyPassword "om4r@Pano#Painter_2018"
}
}
buildTypes {
release {
minifyEnabled false
proguardFile getDefaultProguardFile('proguard-android.txt')
signingConfig signingConfigs.release
}
}
// Encapsulates your external native build configurations.
externalNativeBuild {
// Encapsulates your CMake build configurations.
cmake {
// Provides a relative path to your CMake build script.
path "CMakeLists.txt"
}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['../src/java']
//jniLibs.srcDir 'libs'
res.srcDirs = ['../src/res']
//assets.srcDirs = ['../../assets']
}
}
}
task copyFiles(type: Copy) {
from '../../data/'
into 'src/main/assets/data'
}
preBuild.dependsOn(copyFiles)
task generateVersioning(type: Exec) {
workingDir "$projectDir/../../"
commandLine 'python', 'scripts/pre-build.py', flavor
}
copyFiles.dependsOn(generateVersioning)
task generateJavaH(type: Exec) {
ignoreExitValue true
workingDir "$projectDir"
commandLine 'javah', "-jni", "-force", "-cp", "$classpath", "-d", "$outpath", "$activity"
}
//generateVersioning.dependsOn(generateJavaH)
tasks.whenTaskAdded { task ->
if (task.name.contains('externalNativeBuild')) {
// This dependecy *is* set. This can be seen by using task copyLibs(type: Copy, dependsOn: 'bundleDebug')
// together with this and get a circular dependency.
task.dependsOn generateJavaH
}
}
repositories {
google()
}

View File

@@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx1536M

Binary file not shown.

View File

@@ -0,0 +1,6 @@
#Mon May 27 02:40:42 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip

164
android/quest/gradlew vendored Normal file
View File

@@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
android/quest/gradlew.bat vendored Normal file
View File

@@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -0,0 +1,9 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon Oct 08 14:04:19 CEST 2018
ndk.dir=C\:\\Users\\omar\\AppData\\Local\\Android\\Sdk\\ndk-bundle
sdk.dir=C\:\\Users\\omar\\AppData\\Local\\Android\\Sdk

BIN
android/quest/ppkey.jks Normal file

Binary file not shown.

View File

@@ -0,0 +1,24 @@
<?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

@@ -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

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