git.s-ol.nu forks/DiligentCore / 0051068
Fixed Linux/Mac/iOS build errors assiduous 3 years ago
3 changed file(s) with 17 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
6868 VkIOSSurfaceCreateInfoMVK surfaceCreateInfo = {};
6969
7070 surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK;
71 surfaceCreateInfo.pView = Window.pNSWindow;
71 surfaceCreateInfo.pView = Window.pNSView;
7272
7373 auto err = vkCreateIOSSurfaceMVK(m_VulkanInstance->GetVkInstance(), &surfaceCreateInfo, nullptr, &m_VkSurface);
7474 #elif defined(VK_USE_PLATFORM_MACOS_MVK)
7575 VkMacOSSurfaceCreateInfoMVK surfaceCreateInfo = {};
7676
7777 surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK;
78 surfaceCreateInfo.pView = Window.pNSView;
78 surfaceCreateInfo.pView = Window.pNSWindow;
7979
8080 auto err = vkCreateMacOSSurfaceMVK(m_VulkanInstance->GetVkInstance(), &surfaceCreateInfo, NULL, &m_VkSurface);
8181 #elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
8282 VkWaylandSurfaceCreateInfoKHR surfaceCreateInfo = {};
8383
8484 surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;
85 surfaceCreateInfo.display = Window.pDisplay;
86 surfaceCreatem_VkSurface = Window.pWindow;
85 surfaceCreateInfo.display = reinterpret_cast<struct wl_display*>(Window.pDisplay);
86 surfaceCreateInfo.Surface = reinterpret_cast<struct wl_surface*>(Window.pWindow);
8787
8888 err = vkCreateWaylandSurfaceKHR(m_VulkanInstance->GetVkInstance(), &surfaceCreateInfo, nullptr, &m_VkSurface);
8989 #elif defined(VK_USE_PLATFORM_XCB_KHR)
9090 VkXcbSurfaceCreateInfoKHR surfaceCreateInfo = {};
9191
9292 surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR;
93 surfaceCreateInfo.connection = Window.pXCBConnection;
94 surfaceCreateInfo.window = Window.pWindow;
93 surfaceCreateInfo.connection = reinterpret_cast<xcb_connection_t*>(Window.pXCBConnection);
94 surfaceCreateInfo.window = (xcb_window_t)Window.pWindow;
9595
9696 auto err = vkCreateXcbSurfaceKHR(m_VulkanInstance->GetVkInstance(), &surfaceCreateInfo, nullptr, &m_VkSurface);
9797 #endif
3333 struct Win32NativeWindow
3434 {
3535 void* hWnd DEFAULT_INITIALIZER(nullptr);
36
37 #if DILIGENT_CPP_INTERFACE
38 Win32NativeWindow() noexcept
39 {}
40
41 explicit Win32NativeWindow(void* _hWnd) noexcept :
42 hWnd(hWnd)
43 {}
44 #endif
3645 };
3746
3847 DILIGENT_END_NAMESPACE // namespace Diligent
3737 namespace Testing
3838 {
3939
40 NativeWindow TestingEnvironment::CreateNativeWindow()
40 Win32NativeWindow TestingEnvironment::CreateNativeWindow()
4141 {
4242 #ifdef UNICODE
4343 const auto* const WindowClassName = L"SampleApp";
6161 if (wnd == NULL)
6262 LOG_ERROR_AND_THROW("Unable to create a window");
6363
64 NativeWindow Window;
65 Window.hWnd = wnd;
66
67 return Window;
64 return Win32NativeWindow{wnd};
6865 }
6966
7067 } // namespace Testing