| 895 | } |
| 896 | |
| 897 | static VkSurfaceKHR AppCreateXcbSurface(AppInstance &inst) { |
| 898 | if (!inst.xcb_connection) { |
| 899 | THROW_ERR("AppCreateXcbSurface failed to establish connection"); |
| 900 | } |
| 901 | |
| 902 | VkXcbSurfaceCreateInfoKHR xcb_createInfo; |
| 903 | xcb_createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; |
| 904 | xcb_createInfo.pNext = nullptr; |
| 905 | xcb_createInfo.flags = 0; |
| 906 | xcb_createInfo.connection = inst.xcb_connection; |
| 907 | xcb_createInfo.window = inst.xcb_window; |
| 908 | |
| 909 | VkSurfaceKHR surface; |
| 910 | VkResult err = vkCreateXcbSurfaceKHR(inst.instance, &xcb_createInfo, nullptr, &surface); |
| 911 | if (err) THROW_VK_ERR("vkCreateXcbSurfaceKHR", err); |
| 912 | return surface; |
| 913 | } |
| 914 | |
| 915 | static void AppDestroyXcbWindow(AppInstance &inst) { |
| 916 | if (!inst.xcb_connection) { |
nothing calls this directly
no test coverage detected