Fluid
Loading...
Searching...
No Matches
elevationmaterial.h
Go to the documentation of this file.
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2025 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 * Copyright (C) 2024-2025 hypengw <hypengwip@gmail.com>
6 *
7 * $BEGIN_LICENSE:MPL2$
8 *
9 * This Source Code Form is subject to the terms of the Mozilla Public
10 * License, v. 2.0. If a copy of the MPL was not distributed with this
11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 *
13 * $END_LICENSE$
14 */
15
16#pragma once
17
18#include <QSGMaterial>
19
20namespace Fluid::SceneGraph {
21
22class ElevationMaterial : public QSGMaterial
23{
24public:
27
28 QSGMaterialShader *createShader(QSGRendererInterface::RenderMode) const override;
29 QSGMaterialType *type() const override;
30 int compare(const QSGMaterial *other) const override;
31
32 void init_fadeoff_texture(QQuickWindow *win);
33 auto strength_texture() -> QSGTexture *;
34
35private:
36 QSGTexture *m_fadeoff_texture;
37};
38
39class ElevationShader : public QSGMaterialShader
40{
41public:
43
44 bool updateUniformData(QSGMaterialShader::RenderState &state, QSGMaterial *newMaterial,
45 QSGMaterial *oldMaterial) override;
46
47 void updateSampledImage(RenderState &, int binding, QSGTexture **texture,
48 QSGMaterial *newMaterial, QSGMaterial *) override;
49};
50
51} // namespace Fluid::SceneGraph
Definition elevationmaterial.h:23
ElevationMaterial()
Definition elevationmaterial.cpp:29
QSGMaterialType * type() const override
Definition elevationmaterial.cpp:45
int compare(const QSGMaterial *other) const override
Definition elevationmaterial.cpp:51
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode) const override
Definition elevationmaterial.cpp:40
auto strength_texture() -> QSGTexture *
Definition elevationmaterial.cpp:57
void init_fadeoff_texture(QQuickWindow *win)
Definition elevationmaterial.cpp:61
~ElevationMaterial()
Definition elevationmaterial.cpp:35
Definition elevationmaterial.h:40
ElevationShader()
Definition elevationmaterial.cpp:80
bool updateUniformData(QSGMaterialShader::RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override
Definition elevationmaterial.cpp:87
void updateSampledImage(RenderState &, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *) override
Definition elevationmaterial.cpp:111
Definition rectangle.cpp:28