Skip to content

Commit 2ec1e85

Browse files
committed
Working on android
1 parent 37a3f34 commit 2ec1e85

File tree

141 files changed

+2924
-2336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2924
-2336
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ bin_debug
212212
# Android Studio
213213
.idea
214214
*.iml
215+
*.hprof
216+
gradle
215217
gradlew
216218
gradlew.bat
217-
*.hprof
218219
local.properties
219-
android/gradle
220-
android/app/src/main/jniLibs
220+
android/src/main/jniLibs

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ cmake_policy(VERSION 3.6)
33
include("cmake/defaults.cmake")
44
set(NAME VulkanCppExamples)
55

6+
67
project(${NAME})
78

89
if (NOT "${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
@@ -13,7 +14,6 @@ include("cmake/compiler.cmake")
1314

1415
find_package(Threads REQUIRED)
1516

16-
1717
# This define is specific to Vulkan has a depth range of [0, 1], unlike OpenGL which has a [-1, 1]
1818
add_definitions(-DGLM_FORCE_DEPTH_ZERO_TO_ONE)
1919

@@ -29,8 +29,8 @@ if (NOT ANDROID)
2929
set_target_properties(SetupDebug PROPERTIES FOLDER "CMakeTargets")
3030
endif()
3131

32-
3332
if (ANDROID)
33+
add_definitions(-DVULKAN_HPP_NO_SMART_HANDLE)
3434
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
3535
set(APP_GLUE_DIR ${ANDROID_NDK}/sources/android/native_app_glue)
3636
include_directories(${APP_GLUE_DIR})

android/app/build.gradle

Lines changed: 0 additions & 50 deletions
This file was deleted.

android/app/proguard-rules.pro

Lines changed: 0 additions & 21 deletions
This file was deleted.

android/build.gradle

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,51 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
1+
apply plugin: 'com.android.application'
22

3-
buildscript {
4-
5-
repositories {
6-
google()
7-
jcenter()
3+
android {
4+
compileSdkVersion 26
5+
defaultConfig {
6+
applicationId "org.saintandreas.vulkanexamples"
7+
minSdkVersion 26
8+
targetSdkVersion 26
9+
versionCode 1
10+
versionName "1.0"
11+
ndk { abiFilter "arm64-v8a" }
12+
externalNativeBuild {
13+
cmake {
14+
arguments '-DANDROID_PLATFORM=android-26',
15+
'-DANDROID_TOOLCHAIN=clang',
16+
'-DANDROID_STL=c++_shared',
17+
'-DVULKAN_SDK=' + vulkan_sdk
18+
}
19+
}
20+
compileOptions {
21+
sourceCompatibility JavaVersion.VERSION_1_8
22+
targetCompatibility JavaVersion.VERSION_1_8
23+
}
824
}
9-
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.0.1'
25+
26+
sourceSets {
27+
main {
28+
jniLibs.srcDirs += "${android.ndkDirectory}/sources/third_party/vulkan/src/build-android/jniLibs"
29+
assets.srcDirs += "$projectDir.absolutePath/../data"
30+
}
31+
}
32+
33+
externalNativeBuild {
34+
cmake {
35+
path '../CMakeLists.txt'
36+
}
1137
}
12-
}
1338

14-
allprojects {
15-
repositories {
16-
google()
17-
jcenter()
39+
buildTypes {
40+
release {
41+
minifyEnabled false
42+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
43+
}
1844
}
1945
}
2046

21-
task clean(type: Delete) {
22-
delete rootProject.buildDir
47+
dependencies {
48+
implementation fileTree(dir: 'libs', include: ['*.jar'])
49+
implementation 'com.android.support:appcompat-v7:26.1.0'
50+
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
2351
}

android/settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.

android/app/src/main/AndroidManifest.xml renamed to android/src/main/AndroidManifest.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@
4747
android:name=".examples.ComputeShader">
4848
<meta-data android:name="android.app.lib_name" android:value="computeshader" />
4949
</activity>
50-
<!--
51-
<activity android:configChanges="orientation|screenSize|keyboardHidden" android:launchMode="singleTask" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
52-
android:name=".examples.Context">
53-
<meta-data android:name="android.app.lib_name" android:value="context" />
54-
</activity>
55-
-->
5650
<activity android:configChanges="orientation|screenSize|keyboardHidden" android:launchMode="singleTask" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
5751
android:name=".examples.Deferred">
5852
<meta-data android:name="android.app.lib_name" android:value="deferred" />

0 commit comments

Comments
 (0)