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
Make C++20 module support disabled by default for Vulkan tutorial
- Update tutorial documentation to reflect optional module usage.
- Adjust CMake option `ENABLE_CPP20_MODULE` default to `OFF`.
- Incorporate fallback to traditional header-based includes when modules are disabled.
- Clarify enablement steps and compatibility details in example code and instructions.
That is all that is required to add Vulkan to any project.
170
+
If you choose to keep modules disabled (the default), you can continue to use the
171
+
traditional header-based includes (e.g., `#include <vulkan/vulkan_raii.hpp>`). The
172
+
sample code in the attachments is written to compile either way and will import the
173
+
module only when `ENABLE_CPP20_MODULE=ON` (which defines `USE_CPP20_MODULES`).
166
174
167
175
=== Window Management
168
176
@@ -491,4 +499,4 @@ You are now all set for xref:03_Drawing_a_triangle/00_Setup/00_Base_code.adoc[th
491
499
492
500
== Android
493
501
494
-
Vulkan is a first-class API on Android and widely supported. But using it differs in several key areas from window management to build systems. So while the basic chapters focus on desktop platforms, the tutorial also has a xref:14_Android.adoc[dedicated chapter] that walks you through setting up your development environment and getting the tutorial code up-and-running on Android.
502
+
Vulkan is a first-class API on Android and widely supported. But using it differs in several key areas from window management to build systems. So while the basic chapters focus on desktop platforms, the tutorial also has a xref:14_Android.adoc[dedicated chapter] that walks you through setting up your development environment and getting the tutorial code up-and-running on Android.
# (Optional) Add the Vulkan C++ module when ENABLE_CPP20_MODULE=ON
316
316
add_library(VulkanCppModule SHARED)
317
317
target_compile_definitions(VulkanCppModule
318
318
PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_NO_STRUCT_CONSTRUCTORS=1
@@ -388,7 +388,7 @@ Key points:
388
388
389
389
* We find the Vulkan package and include the game-activity library instead of native_app_glue.
390
390
* We set up shader compilation tools and define a function to compile shaders.
391
-
* We set the C{pp} standard to C{pp}20 and create a Vulkan C{pp} module.
391
+
* We set the C{pp} standard to C{pp}20 and optionally create a Vulkan C{pp} module (recommended) when modules are enabled.
392
392
* We set up shader compilation for the 34_android chapter, copying shader source files from the main project.
393
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.
394
394
* We link against the necessary libraries, including game-activity.
@@ -840,4 +840,4 @@ The complete Android example can be found in the attachments/android directory.
840
840
841
841
Remember that Vulkan HPP is not included by default in the Android NDK, so you'll need to download it separately from the https://github.com/KhronosGroup/Vulkan-Hpp[Vulkan-Hpp GitHub repository] or use the version included in the Vulkan SDK.
0 commit comments