Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
6
8
9namespace QtWaylandClient {
10
11QWaylandVulkanWindow::QWaylandVulkanWindow(QWindow *window, QWaylandDisplay *display)
13{
14}
15
20
22{
23 return QWaylandWindow::Vulkan;
24}
25
27{
28 if (m_surface) {
29 QVulkanInstance *inst = window()->vulkanInstance();
30 if (inst)
31 static_cast<QWaylandVulkanInstance *>(inst->handle())->destroySurface(m_surface);
32 }
33 m_surface = VK_NULL_HANDLE;
34 QWaylandWindow::invalidateSurface();
35}
36
38{
39 if (m_surface)
40 return &m_surface;
41
42 QVulkanInstance *vulkanInstance = window()->vulkanInstance();
43 if (!vulkanInstance) {
44 qWarning() << "Attempted to create Vulkan surface without an instance; was QWindow::setVulkanInstance() called?";
45 return nullptr;
46 }
47
48 auto *waylandVulkanInstance = static_cast<QWaylandVulkanInstance *>(vulkanInstance->handle());
49 m_surface = waylandVulkanInstance->createSurface(this);
50
51 return &m_surface;
52}
53
54} // namespace QtWaylandClient
55
56QT_END_NAMESPACE
QWaylandVulkanWindow(QWindow *window, QWaylandDisplay *display)
void invalidateSurface() override
Invalidates the window's surface by releasing its surface buffers.
Combined button and popup list for selecting options.