Skip to content
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
8 changes: 7 additions & 1 deletion en/14_Android.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Every Android application requires a manifest file that declares important infor
----

Key points:

* We specify a minimum SDK version of 24 (Android 7.0), which is required for Vulkan support.
* We declare that our app uses Vulkan with specific version requirements.
* We set up our main activity (VulkanActivity) as the entry point for our application.
Expand Down Expand Up @@ -147,6 +148,7 @@ public class VulkanActivity extends GameActivity {
----

Key points:

* We extend GameActivity from the Android Game SDK, which provides a more optimized bridge between Java and native code.
* GameActivity offers better performance for games and graphics-intensive applications compared to NativeActivity.
* We load our native library ("vulkan_tutorial_android") which contains our Vulkan implementation.
Expand Down Expand Up @@ -252,6 +254,7 @@ dependencies {
----

Key points:

* We specify the minimum SDK version as 24 (Android 7.0) for Vulkan support.
* We configure CMake to build our native code.
* We include the game-activity dependency for better performance.
Expand Down Expand Up @@ -382,9 +385,10 @@ target_link_libraries(vulkan_tutorial_android
----

Key points:

* We find the Vulkan package and include the game-activity library instead of native_app_glue.
* We set up shader compilation tools and define a function to compile shaders.
* We set the C++ standard to C++20 and create a Vulkan C++ module.
* We set the C{pp} standard to C{pp}20 and create a Vulkan C{pp} module.
* We set up shader compilation for the 34_android chapter, copying shader source files from the main project.
* We add the main native library, which uses the 34_android.cpp file from the main project and a bridge file to connect with GameActivity.
* We link against the necessary libraries, including game-activity.
Expand Down Expand Up @@ -442,6 +446,7 @@ extern "C" {
----

This bridge code:

1. Creates an android_app structure compatible with our Vulkan code
2. Sets up the necessary connections between GameActivity and our code
3. Calls the android_main function in our 34_android.cpp file
Expand Down Expand Up @@ -669,6 +674,7 @@ int main() {
Our cross-platform approach leverages the compiler's built-in platform detection capabilities. Since the `__ANDROID__` macro is automatically defined by the compiler when building for Android, we don't need to explicitly define platform macros in our build system.

This approach has several advantages:

1. *Simplicity*: We don't need to maintain platform-specific compile definitions in our CMake files.
2. *Reliability*: We rely on standard compiler behavior rather than custom definitions.
3. *Maintainability*: Less build system configuration means fewer potential points of failure.
Expand Down
1 change: 1 addition & 0 deletions en/16_Multiple_Objects.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct GameObject {
----

This structure encapsulates:

* The object's transform (position, rotation, scale)
* Per-object uniform buffers (one for each frame in flight)
* Per-object descriptor sets (one for each frame in flight)
Expand Down
Loading