Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsgrendernode.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 QSGRENDERNODE_H
5#define QSGRENDERNODE_H
6
7#include <QtQuick/qsgnode.h>
8
10
14
15class Q_QUICK_EXPORT QSGRenderNode : public QSGNode
16{
17public:
18 enum StateFlag {
19 DepthState = 0x01,
20 StencilState = 0x02,
21 ScissorState = 0x04,
22 ColorState = 0x08,
23 BlendState = 0x10,
24 CullState = 0x20,
25 ViewportState = 0x40,
26 RenderTargetState = 0x80
27 };
28 Q_DECLARE_FLAGS(StateFlags, StateFlag)
29
31 BoundedRectRendering = 0x01,
32 DepthAwareRendering = 0x02,
33 OpaqueRendering = 0x04,
34 NoExternalRendering = 0x08
35 };
36 Q_DECLARE_FLAGS(RenderingFlags, RenderingFlag)
37
38 struct Q_QUICK_EXPORT RenderState {
39 virtual ~RenderState();
40 virtual const QMatrix4x4 *projectionMatrix() const = 0;
41 virtual QRect scissorRect() const = 0;
42 virtual bool scissorEnabled() const = 0;
43 virtual int stencilValue() const = 0;
44 virtual bool stencilEnabled() const = 0;
45 virtual const QRegion *clipRegion() const = 0;
46 virtual void *get(const char *state) const;
47 };
48
50 ~QSGRenderNode() override;
51
52 virtual StateFlags changedStates() const;
53 virtual void prepare();
54 virtual void render(const RenderState *state) = 0;
55 virtual void releaseResources();
56 virtual RenderingFlags flags() const;
57 virtual QRectF rect() const;
58
59 const QMatrix4x4 *projectionMatrix() const;
60 const QMatrix4x4 *matrix() const;
61 const QSGClipNode *clipList() const;
62 qreal inheritedOpacity() const;
63 QRhiRenderTarget *renderTarget() const;
64 QRhiCommandBuffer *commandBuffer() const;
65
66private:
69};
70
71Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRenderNode::StateFlags)
72Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRenderNode::RenderingFlags)
73
75
76#endif
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtCore\reentrant
Definition qrect.h:483
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtGui
Definition qrhi.h:1614
\inmodule QtGui
Definition qrhi.h:1135
The QSGClipNode class implements the clipping functionality in the scene graph.
Definition qsgnode.h:224
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
The QSGRenderNode class represents a set of custom rendering commands targeting the graphics API that...
RenderingFlag
Possible values for the bitmask returned from flags().
StateFlag
This enum is a bit mask identifying several states.
virtual void render(const RenderState *state)=0
This function is called by the renderer and should paint this node with directly invoking commands in...
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
static QDBusError::ErrorType get(const char *name)
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLbitfield flags
GLuint GLenum matrix
double qreal
Definition qtypes.h:92
virtual QRect scissorRect() const =0
virtual int stencilValue() const =0
virtual const QRegion * clipRegion() const =0
virtual const QMatrix4x4 * projectionMatrix() const =0
virtual bool scissorEnabled() const =0
virtual bool stencilEnabled() const =0