@@ -141,33 +141,28 @@ vkDestroyInstance(instance, nullptr);
141141
142142can be directly replaced by this:
143143
144- [,c++]
145- ----
146- vk::raii::Context context;
147- constexpr auto appInfo = vk::ApplicationInfo("Hello Triangle", 1, "No Engine", 1, vk::ApiVersion11);
148- vk::InstanceCreateInfo createInfo({}, &appInfo, {}, {});
149- vk::raii::instance = std::make_unique<vk::raii::Instance>(context, createInfo);
150- ----
151-
152- As this can be a little hard to read when we look at the structures. We have
153- opted to turn on VULKAN_HPP_NO_STRUCT_CONSTRUCTORS. This option means that
154- the above code will look like this throughout the tutorial:
155-
156144[,c++]
157145----
158146constexpr vk::ApplicationInfo appInfo{ .pApplicationName = "Hello Triangle",
159147 .applicationVersion = VK_MAKE_VERSION( 1, 0, 0 ),
160148 .pEngineName = "No Engine",
161149 .engineVersion = VK_MAKE_VERSION( 1, 0, 0 ),
162150 .apiVersion = vk::ApiVersion14 };
151+
163152vk::InstanceCreateInfo createInfo{
164153 .pApplicationInfo = &appInfo
165154};
155+
166156instance = vk::raii::Instance(context, createInfo);
167157----
168158
169- This provides a better meaning towards what each option relates to in the
170- structures that we're depending upon.
159+ NOTE: We use Vulkan-hpp with designated initializers introduced with C++ 20. By default,
160+ Vulkan-hpp uses a different way of initializing and we need to explicitly enable this
161+ by using the `VULKAN_HPP_NO_STRUCT_CONSTRUCTORS` define. This provides a better meaning
162+ towards what each option relates to in the structures that we're depending upon.
163+ For this tutorial, said define is declared in the xref:../../02_Development_environment.adoc#cmake[CMake build setup].
164+ If you use a different build setup, you need to manually define this before including
165+ Vulkan-hpp.
171166
172167== Integrating GLFW
173168
0 commit comments