Skip to content
Open
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
13 changes: 13 additions & 0 deletions en/03_Drawing_a_triangle/00_Setup/00_Base_code.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ import vulkan_hpp;
#include <cstdlib>

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 `<vulkan/vulkan_raii.hpp>` 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();
Expand Down
Loading