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
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
4#ifndef QSGABSTRACTRENDERER_P_H
5#define QSGABSTRACTRENDERER_P_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#include <QtQuick/private/qtquickglobal_p.h>
19#include <QtQuick/qsgnode.h>
20#include <QtCore/qobject.h>
21
22#ifndef GLuint
23#define GLuint uint
24#endif
25
27
29
30class Q_QUICK_EXPORT QSGAbstractRenderer : public QObject
31{
33public:
35 {
36 MatrixTransformFlipY = 0x01
37 };
38 Q_DECLARE_FLAGS(MatrixTransformFlags, MatrixTransformFlag)
39 Q_FLAG(MatrixTransformFlags)
40
41 ~QSGAbstractRenderer() override;
42
43 void setRootNode(QSGRootNode *node);
44 QSGRootNode *rootNode() const;
45 void setDeviceRect(const QRect &rect);
46 inline void setDeviceRect(const QSize &size) { setDeviceRect(QRect(QPoint(), size)); }
47 QRect deviceRect() const;
48
49 void setViewportRect(const QRect &rect);
51 QRect viewportRect() const;
52
53 void setProjectionMatrixToRect(const QRectF &rect);
54 void setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags);
55 void setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags,
56 bool nativeNDCFlipY);
57 void setProjectionMatrix(const QMatrix4x4 &matrix, int index = 0);
58 void setProjectionMatrixWithNativeNDC(const QMatrix4x4 &matrix, int index = 0);
59 QMatrix4x4 projectionMatrix(int index) const;
60 QMatrix4x4 projectionMatrixWithNativeNDC(int index) const;
61 int projectionMatrixCount() const;
62 int projectionMatrixWithNativeNDCCount() const;
63
64 void setClearColor(const QColor &color);
65 QColor clearColor() const;
66
67 virtual void renderScene() = 0;
68
69 virtual void prepareSceneInline();
70 virtual void renderSceneInline();
71
74
75protected:
76 explicit QSGAbstractRenderer(QObject *parent = nullptr);
77 virtual void nodeChanged(QSGNode *node, QSGNode::DirtyState state) = 0;
78
79private:
80 Q_DECLARE_PRIVATE(QSGAbstractRenderer)
81 friend class QSGRootNode;
82};
83
85
86#endif
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore\reentrant
Definition qrect.h:30
QSGAbstractRenderer gives access to the scene graph nodes and rendering.
virtual void renderScene()=0
Renders the scene.
void setDeviceRect(const QSize &size)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setViewportRect(const QSize &size)
This is an overloaded member function, provided for convenience. It differs from the above function o...
MatrixTransformFlag
Used with setProjectionMatrixToRect() to indicate the expectations towards the generated projection m...
void sceneGraphChanged()
This signal is emitted on the first modification of a node in the tree after the last scene render.
virtual void nodeChanged(QSGNode *node, QSGNode::DirtyState state)=0
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
The QSGRootNode is the toplevel root of any scene graph.
Definition qsgnode.h:259
\inmodule QtCore
Definition qsize.h:25
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLuint color
[2]
GLbitfield flags
GLuint GLenum matrix
#define Q_OBJECT
#define Q_FLAG(x)
#define Q_SIGNALS