Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update/Fix Android Example for vsg 1.0 #188

Merged
merged 2 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/platform/vsgandroidnative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ This example demonstates how to create a window, load assests and render a scene
4. At the bottom of the file add the path to your cmake directory (v3.13) like so
cmake.dir=/usr/local/Cellar/cmake/3.13.0
5. Open /app/build.gradle and change the '-Dvsg_DIR' path in the cmake arguments section to point to your Android VSG install path.
* Alternatively, edit app/cpp/CMakeLists.txt and add replace find_package(vsg) with add_subdirectory(/path/to/VulkanSceneGraph vsg). This will build vsg from source, as part of the Android app's CMake project
* Note that when using -Dvsg_DIR or CMAKE_PREFIX_PATH on Android, only paths within the Android sysroot are allowed by default. You can use find_package(vsg NO_CMAKE_FIND_ROOT_PATH) to override this behaviour
6. Build the application


Expand Down
5 changes: 1 addition & 4 deletions examples/platform/vsgandroidnative/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ android {
externalNativeBuild {
cmake {
version "3.13.0"
arguments '-DCMAKE_SYSTEM_NAME="Android', '-DCMAKE_SYSTEM_VERSION=24', '-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a', '-DANDROID_STL=c++_static', '-Dvsg_DIR=/usr/local/android/lib/cmake/vsg'
}
ndk {
abiFilters 'armeabi-v7a'
arguments '-DANDROID_STL=c++_static'
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion examples/platform/vsgandroidnative/app/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ target_include_directories(vsgnative PRIVATE
${ANDROID_NDK}/sources/android/native_app_glue)

# find vsg
find_package(vsg REQUIRED)
# find_package(vsg REQUIRED)
add_subdirectory(/path/to/VulkanSceneGraph vsg)

# add lib dependencies
target_link_libraries(vsgnative
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/vsgandroidnative/app/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct AppData
{
struct android_app* app;

vsg::ref_ptr<vsg::Window::Traits> traits;
vsg::ref_ptr<vsg::WindowTraits> traits;
vsg::ref_ptr<vsg::Viewer> viewer;
vsg::ref_ptr<vsgAndroid::Android_Window> window;

Expand Down
2 changes: 1 addition & 1 deletion examples/platform/vsgandroidnative/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:7.3.0'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Feb 05 19:39:12 IST 2017
#Thu Nov 17 20:42:48 GMT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME