Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.3" | ||
|
||
defaultConfig { | ||
applicationId "kr.pe.burt.android.texture" | ||
minSdkVersion 17 | ||
targetSdkVersion 23 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
testCompile 'junit:junit:4.12' | ||
compile 'com.android.support:appcompat-v7:23.4.0' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/burt/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package kr.pe.burt.android.texture; | ||
|
||
import android.app.Application; | ||
import android.test.ApplicationTestCase; | ||
|
||
/** | ||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | ||
*/ | ||
public class ApplicationTest extends ApplicationTestCase<Application> { | ||
public ApplicationTest() { | ||
super(Application.class); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="kr.pe.burt.android.texture"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity"> | ||
<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,79 @@ | ||
package kr.pe.burt.android.texture; | ||
|
||
import kr.pe.burt.android.texture.glkit.ShaderProgram; | ||
|
||
/** | ||
* Created by burt on 2016. 6. 23.. | ||
*/ | ||
public class Cube extends Model { | ||
|
||
static final float vertices[] = { | ||
// Front | ||
1, -1, 1, 1, 0, 0, 1, 1, 0, // 0 | ||
1, 1, 1, 0, 1, 0, 1, 1, 1, // 1 | ||
-1, 1, 1, 0, 0, 1, 1, 0, 1, // 2 | ||
-1, -1, 1, 0, 0, 0, 1, 0, 0, // 3 | ||
|
||
// Back | ||
-1, -1, -1, 0, 0, 1, 1, 1, 0, // 4 | ||
-1, 1, -1, 0, 1, 0, 1, 1, 1, // 5 | ||
1, 1, -1, 1, 0, 0, 1, 0, 1, // 6 | ||
1, -1, -1, 0, 0, 0, 1, 0, 0, // 7 | ||
|
||
// Left | ||
-1, -1, 1, 1, 0, 0, 1, 1, 0, // 8 | ||
-1, 1, 1, 0, 1, 0, 1, 1, 1, // 9 | ||
-1, 1, -1, 0, 0, 1, 1, 0, 1, // 10 | ||
-1, -1, -1, 0, 0, 0, 1, 0, 0, // 11 | ||
|
||
// Right | ||
1, -1, -1, 1, 0, 0, 1, 1, 0, // 12 | ||
1, 1, -1, 0, 1, 0, 1, 1, 1, // 13 | ||
1, 1, 1, 0, 0, 1, 1, 0, 1, // 14 | ||
1, -1, 1, 0, 0, 0, 1, 0, 0, // 15 | ||
|
||
// Top | ||
1, 1, 1, 1, 0, 0, 1, 1, 0, // 16 | ||
1, 1, -1, 0, 1, 0, 1, 1, 1, // 17 | ||
-1, 1, -1, 0, 0, 1, 1, 0, 1, // 18 | ||
-1, 1, 1, 0, 0, 0, 1, 0, 0, // 19 | ||
|
||
// Bottom | ||
1, -1, -1, 1, 0, 0, 1, 1, 0, // 20 | ||
1, -1, 1, 0, 1, 0, 1, 1, 1, // 21 | ||
-1, -1, 1, 0, 0, 1, 1, 0, 1, // 22 | ||
-1, -1, -1, 0, 0, 0, 1, 0, 0, // 23 | ||
|
||
}; | ||
|
||
static final short indices[] = { | ||
|
||
// Front | ||
0, 1, 2, | ||
2, 3, 0, | ||
|
||
// Back | ||
4, 5, 6, | ||
6, 7, 4, | ||
|
||
// Left | ||
8, 9, 10, | ||
10, 11, 8, | ||
|
||
// Right | ||
12, 13, 14, | ||
14, 15, 12, | ||
|
||
// Top | ||
16, 17, 18, | ||
18, 19, 16, | ||
|
||
// Bottom | ||
20, 21, 22, | ||
22, 23, 20 | ||
}; | ||
|
||
public Cube(ShaderProgram shader) { | ||
super("cube", shader, vertices, indices); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package kr.pe.burt.android.texture; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
private OGLView oglView; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
oglView = (OGLView) findViewById(R.id.oglView); | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
oglView.onPause(); | ||
} | ||
|
||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
oglView.onResume(); | ||
} | ||
} |