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
qsgabstractrenderer_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
5#ifndef QSGABSTRACTRENDERER_P_H
6#define QSGABSTRACTRENDERER_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick/private/qtquickglobal_p.h>
20#include <QtQuick/qsgnode.h>
21#include <QtCore/qobject.h>
22
23#ifndef GLuint
24#define GLuint uint
25#endif
26
27QT_BEGIN_NAMESPACE
28
29class QSGAbstractRendererPrivate;
30
31class Q_QUICK_EXPORT QSGAbstractRenderer : public QObject
32{
33 Q_OBJECT
34public:
35 enum MatrixTransformFlag
36 {
37 MatrixTransformFlipY = 0x01
38 };
39 Q_DECLARE_FLAGS(MatrixTransformFlags, MatrixTransformFlag)
40 Q_FLAG(MatrixTransformFlags)
41
42 ~QSGAbstractRenderer() override;
43
44 void setRootNode(QSGRootNode *node);
45 QSGRootNode *rootNode() const;
46 void setDeviceRect(const QRect &rect);
47 inline void setDeviceRect(const QSize &size) { setDeviceRect(QRect(QPoint(), size)); }
48 QRect deviceRect() const;
49
50 void setViewportRect(const QRect &rect);
51 inline void setViewportRect(const QSize &size) { setViewportRect(QRect(QPoint(), size)); }
52 QRect viewportRect() const;
53
54 void setProjectionMatrixToRect(const QRectF &rect);
55 void setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags);
56 void setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags,
57 bool nativeNDCFlipY);
58 void setProjectionMatrix(const QMatrix4x4 &matrix, int index = 0);
59 void setProjectionMatrixWithNativeNDC(const QMatrix4x4 &matrix, int index = 0);
60 QMatrix4x4 projectionMatrix(int index) const;
61 QMatrix4x4 projectionMatrixWithNativeNDC(int index) const;
62 int projectionMatrixCount() const;
63 int projectionMatrixWithNativeNDCCount() const;
64 void setInvertFrontFace(bool invert);
65 bool invertFrontFace() const;
66
67 void setClearColor(const QColor &color);
68 QColor clearColor() const;
69
70 virtual void renderScene() = 0;
71
72 virtual void prepareSceneInline();
73 virtual void renderSceneInline();
74
75Q_SIGNALS:
76 void sceneGraphChanged();
77
78protected:
79 explicit QSGAbstractRenderer(QObject *parent = nullptr);
80 virtual void nodeChanged(QSGNode *node, QSGNode::DirtyState state) = 0;
81
82private:
83 Q_DECLARE_PRIVATE(QSGAbstractRenderer)
84 friend class QSGRootNode;
85};
86
87QT_END_NAMESPACE
88
89#endif
QSGAbstractRenderer gives access to the scene graph nodes and rendering.
Combined button and popup list for selecting options.