Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylandvulkanwindow.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
7
8namespace QtWaylandClient {
9
14
19
24
26{
27 if (m_surface) {
28 QVulkanInstance *inst = window()->vulkanInstance();
29 if (inst)
30 static_cast<QWaylandVulkanInstance *>(inst->handle())->destroySurface(m_surface);
31 }
32 m_surface = VK_NULL_HANDLE;
34}
35
37{
38 if (m_surface)
39 return &m_surface;
40
41 QVulkanInstance *vulkanInstance = window()->vulkanInstance();
42 if (!vulkanInstance) {
43 qWarning() << "Attempted to create Vulkan surface without an instance; was QWindow::setVulkanInstance() called?";
44 return nullptr;
45 }
46
47 auto *waylandVulkanInstance = static_cast<QWaylandVulkanInstance *>(vulkanInstance->handle());
48 m_surface = waylandVulkanInstance->createSurface(this);
49
50 return &m_surface;
51}
52
53} // namespace QtWaylandClient
54
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
virtual void invalidateSurface()
Invalidates the window's surface by releasing its surface buffers.
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
\inmodule QtGui
Definition qwindow.h:63
QWaylandVulkanWindow(QWindow *window, QWaylandDisplay *display)
void invalidateSurface() override
Invalidates the window's surface by releasing its surface buffers.
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
#define qWarning
Definition qlogging.h:166
aWidget window() -> setWindowTitle("New Window Title")
[2]