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
qopenxrgraphics_opengl_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QOPENXRGRAPHICSOPENGL_H
5#define QOPENXRGRAPHICSOPENGL_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18
19#include <QtQuick3DXr/private/qabstractopenxrgraphics_p.h>
20#include <QtQuick3DXr/private/qopenxrplatform_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QRhiTexture;
25
27{
28public:
30
31 bool isExtensionSupported(const QVector<XrExtensionProperties> &extensions) const override;
32 const char *extensionName() const override;
33 const XrBaseInStructure *handle() const override;
34 bool setupGraphics(const XrInstance &instance, XrSystemId &systemId, const QQuickGraphicsConfiguration &quickConfig) override;
35 bool finializeGraphics(QRhi *rhi) override;
36 int64_t colorSwapchainFormat(const QVector<int64_t> &swapchainFormats) const override;
37 int64_t depthSwapchainFormat(const QVector<int64_t> &swapchainFormats) const override;
38 QVector<XrSwapchainImageBaseHeader*> allocateSwapchainImages(int count, XrSwapchain swapchain) override;
39 QQuickRenderTarget renderTarget(const XrSwapchainSubImage &subImage, const XrSwapchainImageBaseHeader *swapchainImage,
40 quint64 swapchainFormat, int samples, int arraySize,
41 const XrSwapchainImageBaseHeader *depthSwapchainImage, quint64 depthSwapchainFormat) const override;
42 void setupWindow(QQuickWindow *window) override;
43 QRhi *rhi() const override { return m_rhi; }
45
46private:
47#ifdef XR_USE_PLATFORM_WIN32
49#elif defined(XR_USE_PLATFORM_XLIB)
51#elif defined(XR_USE_PLATFORM_XCB)
53#elif defined(XR_USE_PLATFORM_WAYLAND)
55#else
56 XrBaseInStructure m_graphicsBinding{}; // just so that the code compiles
57#endif
59
60 XrGraphicsRequirementsOpenGLKHR m_graphicsRequirements{};
61 QWindow *m_window = nullptr;
62 QRhi *m_rhi = nullptr;
63 mutable QRhiTexture *m_depthTexture = nullptr;
64};
65
66QT_END_NAMESPACE
67
68#endif // QOPENXRGRAPHICSOPENGL_H
const char * extensionName() const override
const XrBaseInStructure * handle() const override
bool finializeGraphics(QRhi *rhi) override
bool isExtensionSupported(const QVector< XrExtensionProperties > &extensions) const override
int64_t colorSwapchainFormat(const QVector< int64_t > &swapchainFormats) const override
QRhi * rhi() const override
bool setupGraphics(const XrInstance &instance, XrSystemId &systemId, const QQuickGraphicsConfiguration &quickConfig) override
QQuickRenderTarget renderTarget(const XrSwapchainSubImage &subImage, const XrSwapchainImageBaseHeader *swapchainImage, quint64 swapchainFormat, int samples, int arraySize, const XrSwapchainImageBaseHeader *depthSwapchainImage, quint64 depthSwapchainFormat) const override
void setupWindow(QQuickWindow *window) override
int64_t depthSwapchainFormat(const QVector< int64_t > &swapchainFormats) const override
QVector< XrSwapchainImageBaseHeader * > allocateSwapchainImages(int count, XrSwapchain swapchain) override
bool checkXrResult(XrResult result, XrInstance instance)
#define GL_SRGB8_ALPHA8_EXT
#define GL_DEPTH_COMPONENT32F
Definition qopenglext.h:994
#define GL_DEPTH24_STENCIL8
#define GL_DEPTH_COMPONENT16
Definition qopenglext.h:328
#define GL_DEPTH_COMPONENT24
Definition qopenglext.h:329
#define GL_RGBA8