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 QOPENGL_CUSTOM_SHADER_STAGE_H
5#define QOPENGL_CUSTOM_SHADER_STAGE_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 <QtOpenGL/qtopenglglobal.h>
19#include <QOpenGLShaderProgram>
20#include <private/qglobal_p.h>
21
22QT_BEGIN_NAMESPACE
23
24
25class QPainter;
26class QOpenGLCustomShaderStagePrivate;
27class Q_OPENGL_EXPORT QOpenGLCustomShaderStage
28{
29 Q_DECLARE_PRIVATE(QOpenGLCustomShaderStage)
30public:
31 QOpenGLCustomShaderStage();
32 virtual ~QOpenGLCustomShaderStage();
33 virtual void setUniforms(QOpenGLShaderProgram*) {}
34
35 void setUniformsDirty();
36
37 bool setOnPainter(QPainter*);
38 void removeFromPainter(QPainter*);
39 QByteArray source() const;
40
41 void setInactive();
42protected:
43 void setSource(const QByteArray&);
44
45private:
46 QOpenGLCustomShaderStagePrivate* d_ptr;
47
48 Q_DISABLE_COPY_MOVE(QOpenGLCustomShaderStage)
49};
50
51
52QT_END_NAMESPACE
53
54
55#endif
56

source code of qtbase/src/opengl/qopenglcustomshaderstage_p.h