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
32
33 bool initialize(const QVector<XrExtensionProperties> &extensions) override;
34 QVector<const char *> getRequiredExtensions() const override;
35 const XrBaseInStructure *handle() const override;
36 bool setupGraphics(const XrInstance &instance, XrSystemId &systemId, const QQuickGraphicsConfiguration &quickConfig) override;
37 bool finializeGraphics(QRhi *rhi) override;
38 int64_t colorSwapchainFormat(const QVector<int64_t> &swapchainFormats) const override;
39 int64_t depthSwapchainFormat(const QVector<int64_t> &swapchainFormats) const override;
40 QVector<XrSwapchainImageBaseHeader*> allocateSwapchainImages(int count, XrSwapchain swapchain) override;
41 QQuickRenderTarget renderTarget(const XrSwapchainSubImage &subImage, const XrSwapchainImageBaseHeader *swapchainImage,
42 quint64 swapchainFormat, int samples, int arraySize,
43 const XrSwapchainImageBaseHeader *depthSwapchainImage, quint64 depthSwapchainFormat) const override;
44 void setupWindow(QQuickWindow *window) override;
45 QRhi *rhi() const override { return m_rhi; }
47
48private:
49 enum PlatformType m_selectedPlatform = PLATFORM_UNSUPPORTED;
50 QVector<const char *> m_requiredExtensions;
51 std::unique_ptr<XrBaseInStructure, decltype(&std::free)> m_graphicsBinding = { nullptr, std::free };
52
54
55 XrGraphicsRequirementsOpenGLKHR m_graphicsRequirements{};
56 QWindow *m_window = nullptr;
57 QRhi *m_rhi = nullptr;
58 mutable QRhiTexture *m_depthTexture = nullptr;
59};
60
61QT_END_NAMESPACE
62
63#endif // QOPENXRGRAPHICSOPENGL_H
const XrBaseInStructure * handle() const override
QVector< const char * > getRequiredExtensions() const override
bool finializeGraphics(QRhi *rhi) 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
bool initialize(const QVector< XrExtensionProperties > &extensions) 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)
Combined button and popup list for selecting options.
#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