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
qxcbvulkanwindow.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 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
4#include "qxcbvulkanwindow.h"
5
7
10 m_surface(VK_NULL_HANDLE)
11{
12}
13
15{
16 if (m_surface) {
17 QVulkanInstance *inst = window()->vulkanInstance();
18 if (inst)
19 static_cast<QXcbVulkanInstance *>(inst->handle())->destroySurface(m_surface);
20 }
21}
22
33
34// No createVisual() needed, use the default that picks one based on the R/G/B/A size.
35
37{
38 if (m_surface)
39 return &m_surface;
40
41 QVulkanInstance *inst = window()->vulkanInstance();
42 if (!inst) {
43 qWarning("Attempted to create Vulkan surface without an instance; was QWindow::setVulkanInstance() called?");
44 return nullptr;
45 }
46 QXcbVulkanInstance *xcbinst = static_cast<QXcbVulkanInstance *>(inst->handle());
47 m_surface = xcbinst->createSurface(this);
48
49 return &m_surface;
50}
51
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
int blueBufferSize() const
Get the size in bits of the blue channel of the color buffer.
void setGreenBufferSize(int size)
Set the desired size in bits of the green channel of the color buffer.
void setRedBufferSize(int size)
Set the desired size in bits of the red channel of the color buffer.
void setBlueBufferSize(int size)
Set the desired size in bits of the blue channel of the color buffer.
int redBufferSize() const
Get the size in bits of the red channel of the color buffer.
int greenBufferSize() const
Get the size in bits of the green channel of the color buffer.
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
\inmodule QtGui
Definition qwindow.h:63
VkSurfaceKHR * surface()
QXcbVulkanWindow(QWindow *window)
void resolveFormat(const QSurfaceFormat &format) override
QSurfaceFormat format() const override
Returns the actual surface format of the window.
QSurfaceFormat m_format
Definition qxcbwindow.h:236
Combined button and popup list for selecting options.
#define qWarning
Definition qlogging.h:166
GLint GLsizei GLsizei GLenum format
aWidget window() -> setWindowTitle("New Window Title")
[2]