///////////////////////////////////////////////////////
| 182 | |
| 183 | //////////////////////////////////////////////////////////// |
| 184 | bool VulkanImpl::createVulkanSurface(const VkInstance& instance, |
| 185 | WindowHandle windowHandle, |
| 186 | VkSurfaceKHR& surface, |
| 187 | const VkAllocationCallbacks* allocator) |
| 188 | { |
| 189 | if (!isAvailable()) |
| 190 | return false; |
| 191 | |
| 192 | // Make a copy of the instance handle since we get it passed as a reference |
| 193 | VkInstance inst = instance; |
| 194 | |
| 195 | auto vkCreateWin32SurfaceKHR = reinterpret_cast<PFN_vkCreateWin32SurfaceKHR>( |
| 196 | wrapper.vkGetInstanceProcAddr(inst, "vkCreateWin32SurfaceKHR")); |
| 197 | |
| 198 | if (!vkCreateWin32SurfaceKHR) |
| 199 | return false; |
| 200 | |
| 201 | VkWin32SurfaceCreateInfoKHR surfaceCreateInfo = VkWin32SurfaceCreateInfoKHR(); |
| 202 | surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; |
| 203 | surfaceCreateInfo.hinstance = GetModuleHandleA(nullptr); |
| 204 | surfaceCreateInfo.hwnd = windowHandle; |
| 205 | |
| 206 | return vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, allocator, &surface) == VK_SUCCESS; |
| 207 | } |
| 208 | |
| 209 | } // namespace sf::priv |
nothing calls this directly
no test coverage detected