|
1 | | -= Android Project for Vulkan Tutorial |
| 1 | += Android Project for Vulkan Game Engine Tutorial |
2 | 2 |
|
3 | | -This Android project allows you to run different chapters of the Vulkan Tutorial on Android devices. |
| 3 | +This Android project allows you to run the Game Engine's example code in Android. It demonstrates how to manage a non-trivial project across Desktop and mobile environments from the same code base. |
4 | 4 |
|
5 | | -== Selecting a Chapter |
| 5 | +== Project Overview |
6 | 6 |
|
7 | | -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. |
| 7 | +The Vulkan Game Engine Tutorial is a comprehensive learning project that showcases modern graphics programming using the Vulkan API. |
| 8 | +This Android port enables running the same engine code on mobile devices, demonstrating cross-platform development practices. |
8 | 9 |
|
9 | | -=== Available Chapters |
| 10 | +== Prerequisites |
10 | 11 |
|
11 | | -* `34_android`: The Android chapter that uses tinyobjloader to load OBJ models |
12 | | -* `35_gltf_ktx`: The glTF and KTX chapter that uses tinygltf to load glTF models and KTX to load KTX2 textures |
| 12 | +* Android Studio 4.2 or higher |
| 13 | +* Android NDK r21 or higher |
| 14 | +* CMake 3.10+ |
| 15 | +* Vulkan SDK |
| 16 | +* Android device with Vulkan support (Android 7.0+) |
13 | 17 |
|
14 | | -=== How to Select a Chapter |
| 18 | +== Building and Running |
15 | 19 |
|
16 | | -==== From the Command Line |
| 20 | +1. Open the project in Android Studio |
| 21 | +2. Sync Gradle files |
| 22 | +3. Build the project |
| 23 | +4. Run on your Android device or emulator |
17 | 24 |
|
18 | | -[source,bash] |
19 | | ----- |
20 | | -./gradlew assembleDebug -Pchapter=35_gltf_ktx |
21 | | ----- |
| 25 | +== Project Structure |
22 | 26 |
|
23 | | -==== From Android Studio |
| 27 | +* `app/` - Android-specific code and resources |
| 28 | +* `src/` - Shared C++ engine code |
| 29 | +* `assets/` - Shared game assets and shaders (automatically copied by Gradle) |
| 30 | +** `models/` - GLTF/GLB model files |
| 31 | +** `shaders/` - Compiled SPIR-V shader files |
| 32 | +** `textures/` - Texture assets |
| 33 | +* `CMake/` - Build configuration files |
24 | 34 |
|
25 | | -1. Edit the `gradle.properties` file in the project root directory |
26 | | -2. Add the following line: |
27 | | -+ |
28 | | -[source] |
29 | | ----- |
30 | | -chapter=35_gltf_ktx |
31 | | ----- |
32 | | -3. Sync the project and build |
| 35 | +== Asset Management |
33 | 36 |
|
34 | | -== Adding New Chapters |
| 37 | +The project uses Gradle to automatically handle asset deployment. |
| 38 | +Place your assets in the following source locations: |
35 | 39 |
|
36 | | -To add support for a new chapter: |
| 40 | +* Source assets location: `<project_root>/assets/` |
| 41 | +* Gradle will automatically copy assets to: `app/src/main/assets/` |
| 42 | +* Asset changes will be synchronized during build |
37 | 43 |
|
38 | | -1. Add the chapter name to the `SUPPORTED_CHAPTERS` list in `app/src/main/cpp/CMakeLists.txt` |
39 | | -2. Add any chapter-specific libraries and compile definitions in the same file |
40 | | -3. Make sure the chapter's source file exists in the `attachments` directory |
| 44 | +== Key Components |
41 | 45 |
|
42 | | -For example, to add support for a hypothetical `36_new_feature` chapter: |
| 46 | +* GLTF model loading support |
| 47 | +* Cross-platform rendering pipeline |
| 48 | +* JSON configuration using nlohmann_json |
| 49 | +* Unified asset management system with Gradle automation |
43 | 50 |
|
44 | | -[source,cmake] |
45 | | ----- |
46 | | -# Define the list of supported chapters |
47 | | -set(SUPPORTED_CHAPTERS |
48 | | - "34_android" |
49 | | - "35_gltf_ktx" |
50 | | - "36_new_feature" |
51 | | -) |
52 | | -
|
53 | | -# Add chapter-specific libraries and definitions |
54 | | -if(CHAPTER STREQUAL "34_android") |
55 | | - # ... |
56 | | -elseif(CHAPTER STREQUAL "35_gltf_ktx") |
57 | | - # ... |
58 | | -elseif(CHAPTER STREQUAL "36_new_feature") |
59 | | - target_link_libraries(vulkan_tutorial_android |
60 | | - # Add any required libraries here |
61 | | - ) |
62 | | -
|
63 | | - target_compile_definitions(vulkan_tutorial_android PRIVATE |
64 | | - # Add any required compile definitions here |
65 | | - ) |
66 | | -endif() |
67 | | ----- |
| 51 | +The project demonstrates professional-grade techniques for maintaining a single codebase that targets both desktop and mobile platforms while leveraging modern C++20 features and Vulkan's cross-platform capabilities. |
0 commit comments