Skip to content

Commit 234ced3

Browse files
committed
Finalized demo changes and conformed to clang-format
1 parent deae2e4 commit 234ced3

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

demos/1-instance/application.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <span>
1616
import vk;
1717

18-
1918
static VKAPI_ATTR VkBool32 VKAPI_CALL
2019
debug_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

Comments
 (0)