This Android project allows you to run different chapters of the Vulkan Tutorial on Android devices.
By default, the project builds and runs the 34_android chapter. You can select a different chapter by setting the chapter property in your Gradle build.
-
34_android: The Android chapter that uses tinyobjloader to load OBJ models -
35_gltf_ktx: The glTF and KTX chapter that uses tinygltf to load glTF models and KTX to load KTX2 textures
To add support for a new chapter:
-
Add the chapter name to the
SUPPORTED_CHAPTERSlist inapp/src/main/cpp/CMakeLists.txt -
Add any chapter-specific libraries and compile definitions in the same file
-
Make sure the chapter’s source file exists in the
attachmentsdirectory
For example, to add support for a hypothetical 36_new_feature chapter:
# Define the list of supported chapters
set(SUPPORTED_CHAPTERS
"34_android"
"35_gltf_ktx"
"36_new_feature"
)
# Add chapter-specific libraries and definitions
if(CHAPTER STREQUAL "34_android")
# ...
elseif(CHAPTER STREQUAL "35_gltf_ktx")
# ...
elseif(CHAPTER STREQUAL "36_new_feature")
target_link_libraries(vulkan_tutorial_android
# Add any required libraries here
)
target_compile_definitions(vulkan_tutorial_android PRIVATE
# Add any required compile definitions here
)
endif()