4plEditorProcessViewWindow::~plEditorProcessViewWindow()
6 if (m_hWnd.type == plWindowHandle::Type::XCB)
8 plGALDevice::GetDefaultDevice()->
WaitIdle();
10 PL_ASSERT_DEV(m_iReferenceCount == 0,
"The window is still being referenced, probably by a swapchain. Make sure to destroy all swapchains and call plGALDevice::WaitIdle before destroying a window.");
11 xcb_disconnect(m_hWnd.xcbWindow.m_pConnection);
12 m_hWnd.xcbWindow.m_pConnection =
nullptr;
13 m_hWnd.type = plWindowHandle::Type::Invalid;
17plResult plEditorProcessViewWindow::UpdateWindow(plWindowHandle parentWindow, plUInt16 uiWidth, plUInt16 uiHeight)
19 if (m_hWnd.type == plWindowHandle::Type::Invalid)
26 m_hWnd.type = plWindowHandle::Type::XCB;
27 m_hWnd.xcbWindow.m_pConnection = xcb_connect(NULL, &scr);
28 if (
auto err = xcb_connection_has_error(m_hWnd.xcbWindow.m_pConnection); err != 0)
30 plLog::Error(
"Could not connect to x11 via xcb. Error-Code '{}'", err);
31 xcb_disconnect(m_hWnd.xcbWindow.m_pConnection);
32 m_hWnd.xcbWindow.m_pConnection =
nullptr;
33 m_hWnd.type = plWindowHandle::Type::Invalid;
37 m_hWnd.xcbWindow.m_Window = parentWindow.xcbWindow.m_Window;
41 m_uiHeight = uiHeight;
42 PL_ASSERT_DEV(parentWindow.type == plWindowHandle::Type::XCB && parentWindow.xcbWindow.m_Window != 0,
"Invalid handle passed");
43 PL_ASSERT_DEV(m_hWnd.xcbWindow.m_Window == parentWindow.xcbWindow.m_Window,
"Remote window handle should never change. Window must be destroyed and recreated.");
void WaitIdle()
Waits for the GPU to be idle and destroys any pending resources and GPU objects.
Definition Device.cpp:1433
static void Error(plLogInterface *pInterface, const plFormatString &string)
An error that needs to be fixed as soon as possible.
Definition Log.cpp:375
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54