Qt 6.x
The Qt SDK
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_PRIVATE_EXPORT QSGAbstractRenderer : public QObject
31{
33public:
35 {
36 ClearColorBuffer = 0x0001,
37 ClearDepthBuffer = 0x0002,
38 ClearStencilBuffer = 0x0004
39 };
40 Q_DECLARE_FLAGS(ClearMode, ClearModeBit)
41 Q_FLAG(ClearMode)
42
44 {
45 MatrixTransformFlipY = 0x01
46 };
47 Q_DECLARE_FLAGS(MatrixTransformFlags, MatrixTransformFlag)
48 Q_FLAG(MatrixTransformFlags)
49
50 ~QSGAbstractRenderer() override;
51
52 void setRootNode(QSGRootNode *node);
53 QSGRootNode *rootNode() const;
54 void setDeviceRect(const QRect &rect);
55 inline void setDeviceRect(const QSize &size) { setDeviceRect(QRect(QPoint(), size)); }
56 QRect deviceRect() const;
57
58 void setViewportRect(const QRect &rect);
60 QRect viewportRect() const;
61
62 void setProjectionMatrixToRect(const QRectF &rect);
63 void setProjectionMatrixToRect(const QRectF &rect, MatrixTransformFlags flags);
64 void setProjectionMatrix(const QMatrix4x4 &matrix);
65 void setProjectionMatrixWithNativeNDC(const QMatrix4x4 &matrix);
66 QMatrix4x4 projectionMatrix() const;
67 QMatrix4x4 projectionMatrixWithNativeNDC() const;
68
69 void setClearColor(const QColor &color);
70 QColor clearColor() const;
71
72 void setClearMode(ClearMode mode);
73 ClearMode clearMode() const;
74
75 virtual void renderScene() = 0;
76
77 virtual void prepareSceneInline();
78 virtual void renderSceneInline();
79
82
83protected:
84 explicit QSGAbstractRenderer(QObject *parent = nullptr);
85 virtual void nodeChanged(QSGNode *node, QSGNode::DirtyState state) = 0;
86
87private:
88 Q_DECLARE_PRIVATE(QSGAbstractRenderer)
89 friend class QSGRootNode;
90};
91
93
95
96#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:90
\inmodule QtCore\reentrant
Definition qpoint.h:23
\inmodule QtCore\reentrant
Definition qrect.h:483
\inmodule QtCore\reentrant
Definition qrect.h:30
QSGAbstractRenderer gives access to the scene graph nodes and rendering.
ClearModeBit
Used with setClearMode() to indicate which buffer should be cleared before the scene render.
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:262
\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
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLenum mode
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLbitfield flags
GLuint GLenum matrix
#define Q_OBJECT
#define Q_FLAG(x)
#define Q_SIGNALS
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent