Skip to content

Commit

Permalink
[example/triangle] construct vk::raii::SurfaceKHR
Browse files Browse the repository at this point in the history
  • Loading branch information
feelamee committed Oct 27, 2024
1 parent e422a2a commit b584f6d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions example/triangle/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@ main()
}()
};

auto const surface{ [&]() -> vk::raii::SurfaceKHR
{
VkSurfaceKHR raw_surface{};
if (!SDL_Vulkan_CreateSurface(window, *instance, nullptr, &raw_surface))
{
throw sdl_error{
std::format("SDL_Vulkan_CreateSurface failed with: '{}'", SDL_GetError())
};
}

return { instance, raw_surface };
}() };

vk::raii::PhysicalDevice const physical_device{ instance.enumeratePhysicalDevices().at(0) };

std::uint32_t const queue_family_index{
Expand Down

0 comments on commit b584f6d

Please sign in to comment.