Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #45 from googlesamples/release-turing
Browse files Browse the repository at this point in the history
Release turing
  • Loading branch information
jguomoto committed Aug 7, 2015
2 parents fc8d2c4 + 285d304 commit b976b6c
Show file tree
Hide file tree
Showing 37 changed files with 2,189 additions and 0 deletions.
43 changes: 43 additions & 0 deletions rgb-depth-sync-example/app/build.gradle
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'])
}
31 changes: 31 additions & 0 deletions rgb-depth-sync-example/app/src/main/AndroidManifest.xml
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>
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();
}
}
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);
}
Loading

0 comments on commit b976b6c

Please sign in to comment.