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
qsgmaterial.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QSGMATERIAL_H
5#define QSGMATERIAL_H
6
7#include <QtQuick/qtquickglobal.h>
8#include <QtQuick/qsgmaterialshader.h>
9#include <QtQuick/qsgmaterialtype.h>
10#include <QtQuick/qsgrendererinterface.h>
11
13
14class Q_QUICK_EXPORT QSGMaterial
15{
16public:
17 enum Flag {
18 Blending = 0x0001,
19 RequiresDeterminant = 0x0002, // Allow precalculated translation and 2D rotation
20 RequiresFullMatrixExceptTranslate = 0x0004 | RequiresDeterminant, // Allow precalculated translation
21 RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate,
22 NoBatching = 0x0010,
23
24 MultiView2 = 0x10000,
25 MultiView3 = 0x20000,
26 MultiView4 = 0x40000,
27
28#if QT_DEPRECATED_SINCE(6, 3)
29 CustomCompileStep Q_DECL_ENUMERATOR_DEPRECATED_X(
30 "Qt 6 does not have custom shader compilation support. If the intention is to just disable batching, use NoBatching instead."
31 ) = NoBatching
32#endif
33
34 };
36
38 virtual ~QSGMaterial();
39
40 virtual QSGMaterialType *type() const = 0;
42 virtual int compare(const QSGMaterial *other) const;
43
44 QSGMaterial::Flags flags() const { return m_flags; }
45 void setFlag(Flags flags, bool on = true);
46
47 int viewCount() const;
48
49private:
50 Flags m_flags;
51 void *m_reserved;
52 Q_DISABLE_COPY(QSGMaterial)
53};
54
55Q_DECLARE_OPERATORS_FOR_FLAGS(QSGMaterial::Flags)
56
58
59#endif
The QSGMaterialShader class represents a graphics API independent shader program.
The QSGMaterial class encapsulates rendering state for a shader program.
Definition qsgmaterial.h:15
virtual QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const =0
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
QSGMaterial::Flags flags() const
Returns the material's flags.
Definition qsgmaterial.h:44
virtual QSGMaterialType * type() const =0
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
Flag
\value Blending Set this flag to true if the material requires blending to be enabled during renderin...
Definition qsgmaterial.h:17
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
Combined button and popup list for selecting options.
#define Q_DECL_ENUMERATOR_DEPRECATED_X(x)
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
Flags
GLbitfield flags
static int compare(quint64 a, quint64 b)
QSharedPointer< T > other(t)
[5]
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.