This repository has been archived by the owner on Mar 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from googlesamples/release-turing
Release turing
- Loading branch information
Showing
37 changed files
with
2,189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 19 | ||
buildToolsVersion "21.1.2" | ||
|
||
defaultConfig { | ||
applicationId "com.projecttango.experiments.rgbdepthsyncexample" | ||
minSdkVersion 19 | ||
targetSdkVersion 19 | ||
} | ||
|
||
sourceSets.main { | ||
jniLibs.srcDir 'src/main/libs' | ||
jni.srcDirs = []; | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
compileTask -> compileTask.dependsOn ndkBuild | ||
} | ||
|
||
task ndkBuild(type: Exec) { | ||
Properties properties = new Properties() | ||
properties.load(project.rootProject.file('local.properties').newDataInputStream()) | ||
def ndkbuild = properties.getProperty('ndk.dir', null)+"/ndk-build" | ||
commandLine ndkbuild, '-C', file('src/main/jni').absolutePath | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.projecttango.experiments.rgbdepthsync" | ||
android:versionCode="0" | ||
android:versionName="0" > | ||
|
||
<uses-sdk | ||
android:minSdkVersion="19" | ||
android:targetSdkVersion="19" /> | ||
|
||
<uses-permission android:name="android.permission.CAMERA" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" > | ||
<uses-library | ||
android:name="com.projecttango.libtango_device" | ||
android:required="true" /> | ||
<activity | ||
android:name=".MainActivity" | ||
android:label="@string/app_name" | ||
android:screenOrientation="landscape"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
46 changes: 46 additions & 0 deletions
46
...xample/app/src/main/java/com/projecttango/experiments/rgbdepthsync/GLSurfaceRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2014 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.projecttango.experiments.rgbdepthsync; | ||
|
||
import android.opengl.GLSurfaceView; | ||
|
||
import javax.microedition.khronos.egl.EGLConfig; | ||
import javax.microedition.khronos.opengles.GL10; | ||
|
||
/** | ||
* GLSurfaceRenderer renders graphic content. | ||
*/ | ||
public class GLSurfaceRenderer implements GLSurfaceView.Renderer { | ||
|
||
private MainActivity mMainActivity; | ||
|
||
public GLSurfaceRenderer(MainActivity mainActivity) { | ||
mMainActivity = mainActivity; | ||
} | ||
|
||
public void onDrawFrame(GL10 gl) { | ||
JNIInterface.render(); | ||
} | ||
|
||
public void onSurfaceChanged(GL10 gl, int width, int height) { | ||
JNIInterface.setViewPort(width, height); | ||
} | ||
|
||
public void onSurfaceCreated(GL10 gl, EGLConfig config) { | ||
mMainActivity.surfaceCreated(); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...ync-example/app/src/main/java/com/projecttango/experiments/rgbdepthsync/JNIInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2014 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.projecttango.experiments.rgbdepthsync; | ||
|
||
import android.app.Activity; | ||
|
||
/** | ||
* Interfaces between C and Java. | ||
*/ | ||
public class JNIInterface { | ||
static { | ||
System.loadLibrary("rgb_depth_sync_example"); | ||
} | ||
|
||
public static native int tangoInitialize(Activity activity); | ||
|
||
public static native int tangoSetupConfig(); | ||
|
||
public static native int tangoConnectTexture(); | ||
|
||
public static native int tangoConnect(); | ||
|
||
public static native int tangoConnectCallbacks(); | ||
|
||
public static native int tangoSetIntrinsicsAndExtrinsics(); | ||
|
||
public static native void tangoDisconnect(); | ||
|
||
public static native void initializeGLContent(); | ||
|
||
public static native void freeGLContent(); | ||
|
||
public static native void setViewPort(int width, int height); | ||
|
||
public static native void render(); | ||
|
||
public static native void setDepthAlphaValue(float alpha); | ||
} |
Oops, something went wrong.