1515#include < span>
1616import vk;
1717
18-
1918static VKAPI_ATTR VkBool32 VKAPI_CALL
2019debug_callback (
2120 [[maybe_unused]] VkDebugUtilsMessageSeverityFlagBitsEXT p_message_severity,
@@ -83,7 +82,7 @@ main() {
8382 std::string title = " Hello Window" ;
8483 GLFWwindow* window =
8584 glfwCreateWindow (width, height, title.c_str (), nullptr , nullptr );
86-
85+
8786 glfwMakeContextCurrent (window);
8887
8988 std::array<const char *, 1 > validation_layers = {
@@ -95,29 +94,33 @@ main() {
9594 initialize_instance_extensions ();
9695
9796 vk::debug_message_utility debug_callback_info = {
98- .severity = vk::message::verbose | vk::message::warning | vk::message::error,
99- .message_type = vk::debug::general | vk::debug::validation | vk::debug::performance,
97+ .severity =
98+ vk::message::verbose | vk::message::warning | vk::message::error,
99+ .message_type =
100+ vk::debug::general | vk::debug::validation | vk::debug::performance,
100101 .callback = debug_callback
101102 };
102103
103104 vk::application_params config = {
104105 .name = " vulkan instance" ,
105106 .version = vk::api_version::vk_1_3, // specify to using vulkan 1.3
106- .validations = validation_layers, // .validation takes in a std::span<const char*>
107- .extensions = global_extensions // .extensions also takes in std::span<const char*>
107+ .validations =
108+ validation_layers, // .validation takes in a std::span<const char*>
109+ .extensions =
110+ global_extensions // .extensions also takes in std::span<const char*>
108111 };
109112
110113 vk::instance api_instance (config, debug_callback_info);
111114
112- std::span<const vk::layer_properties> properties = api_instance.validation ();
113- for (vk::layer_properties property : properties) {
115+ std::span<const vk::layer_properties> properties =
116+ api_instance.validation ();
117+ for (vk::layer_properties property : properties) {
114118 std::println (" Validation Layer Name:\t\t {}" , property.name );
115119 std::println (" Validation Layer Description: {}" , property.description );
116120 }
117121
118122 while (!glfwWindowShouldClose (window)) {
119123 glfwPollEvents ();
120-
121124 }
122125
123126 glfwDestroyWindow (window);
0 commit comments