You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* We find the Vulkan package and include the game-activity library instead of native_app_glue.
386
390
* We set up shader compilation tools and define a function to compile shaders.
387
-
* We set the C++ standard to C++20 and create a Vulkan C++ module.
391
+
* We set the C{pp} standard to C{pp}20 and create a Vulkan C{pp} module.
388
392
* We set up shader compilation for the 34_android chapter, copying shader source files from the main project.
389
393
* 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.
390
394
* We link against the necessary libraries, including game-activity.
@@ -442,6 +446,7 @@ extern "C" {
442
446
----
443
447
444
448
This bridge code:
449
+
445
450
1. Creates an android_app structure compatible with our Vulkan code
446
451
2. Sets up the necessary connections between GameActivity and our code
447
452
3. Calls the android_main function in our 34_android.cpp file
@@ -669,6 +674,7 @@ int main() {
669
674
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.
670
675
671
676
This approach has several advantages:
677
+
672
678
1. *Simplicity*: We don't need to maintain platform-specific compile definitions in our CMake files.
673
679
2. *Reliability*: We rely on standard compiler behavior rather than custom definitions.
674
680
3. *Maintainability*: Less build system configuration means fewer potential points of failure.
0 commit comments