KWin
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
contrastshader.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2010 Fredrik Höglund <fredrik@kde.org>
3 SPDX-FileCopyrightText: 2014 Marco Martin <mart@kde.org>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "opengl/glutils.h"
11
12class QMatrix4x4;
13
14namespace KWin
15{
16
18{
19public:
21
22 void init();
23 void setColorMatrix(const QMatrix4x4 &matrix);
24 void setTextureMatrix(const QMatrix4x4 &matrix);
25 void setModelViewProjectionMatrix(const QMatrix4x4 &matrix);
26 void setOpacity(float opacity);
27
28 float opacity() const;
29 bool isValid() const;
30
31 void bind();
32 void unbind();
33
34protected:
35 void setIsValid(bool value);
36 void reset();
37
38private:
39 bool m_valid;
40 std::unique_ptr<GLShader> m_shader;
41 int m_mvpMatrixLocation;
42 int m_textureMatrixLocation;
43 int m_colorMatrixLocation;
44 int m_opacityLocation;
45 float m_opacity;
46};
47
48} // namespace KWin
void setColorMatrix(const QMatrix4x4 &matrix)
void setTextureMatrix(const QMatrix4x4 &matrix)
void setOpacity(float opacity)
void setIsValid(bool value)
void setModelViewProjectionMatrix(const QMatrix4x4 &matrix)