diff --git a/en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc b/en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc index eeaf0702..a5ad4232 100644 --- a/en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc +++ b/en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc @@ -38,6 +38,19 @@ import vulkan_hpp; #include class HelloTriangleApplication { +---- + +The `#if defined(__INTELLISENSE__) || !defined(USE_CPP20_MODULES)` block picks +between two ways of pulling in the Vulkan-Hpp API. When `USE_CPP20_MODULES` is +defined, we `import vulkan_hpp;` as a C++20 module. Visual Studio and VS Code's +IntelliSense engine doesn't yet understand `import` for modules and will flag +it as an error even though the code compiles fine, so we fall back to +including the traditional `` header whenever +`__INTELLISENSE__` is defined (which IntelliSense itself defines while +analyzing the code) or when modules are turned off entirely. + +[,c++] +---- public: void run() { initVulkan();