| 856 | #endif |
| 857 | |
| 858 | void SurfaceContext::Destroy() { |
| 859 | #if defined(VK_USE_PLATFORM_WIN32_KHR) |
| 860 | if (m_win32Window != nullptr) { |
| 861 | DestroyWindow(m_win32Window); |
| 862 | m_win32Window = nullptr; |
| 863 | } |
| 864 | #endif |
| 865 | |
| 866 | #if defined(VK_USE_PLATFORM_XLIB_KHR) |
| 867 | if (m_surface_dpy != nullptr) { |
| 868 | // Ignore BadDrawable errors we seem to get during shutdown. |
| 869 | // The default error handler will exit() and end the test suite. |
| 870 | XSetErrorHandler(IgnoreXErrors); |
| 871 | XDestroyWindow(m_surface_dpy, m_surface_window); |
| 872 | m_surface_window = None; |
| 873 | XCloseDisplay(m_surface_dpy); |
| 874 | m_surface_dpy = nullptr; |
| 875 | XSetErrorHandler(nullptr); |
| 876 | } |
| 877 | #endif |
| 878 | #if defined(VK_USE_PLATFORM_XCB_KHR) |
| 879 | if (m_surface_xcb_conn != nullptr) { |
| 880 | xcb_disconnect(m_surface_xcb_conn); |
| 881 | m_surface_xcb_conn = nullptr; |
| 882 | } |
| 883 | #endif |
| 884 | #if defined(VK_USE_PLATFORM_WAYLAND_KHR) |
| 885 | if (m_wayland_context.display) { |
| 886 | m_wayland_context.Release(); |
| 887 | } |
| 888 | #endif |
| 889 | } |
| 890 | |
| 891 | // Queries the info needed to create a swapchain and assigns it to the member variables of VkRenderFramework |
| 892 | void VkRenderFramework::InitSwapchainInfo() { |
no test coverage detected