neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_fragment_shader.hpp
Go to the documentation of this file.
1// i_fragment_shader.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2019, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
23#include <neogfx/gfx/color.hpp>
30
31namespace neogfx
32{
33 struct no_stipple_vertex : std::logic_error { no_stipple_vertex() : std::logic_error{ "neogfx::no_stipple_vertex" } {} };
34
36
37 class i_fragment_shader : public i_shader
38 {
39 public:
41 };
42
44 {
45 public:
47 public:
48 virtual void clear_gradient() = 0;
49 virtual void set_gradient(i_rendering_context& aContext, const gradient& aGradient) = 0;
50 virtual void set_gradient(i_rendering_context& aContext, const game::gradient& aGradient) = 0;
51 };
52
54 {
55 public:
57 public:
58 virtual void clear_texture() = 0;
59 virtual void set_texture(const i_texture& aTexture) = 0;
60 virtual void set_effect(shader_effect aEffect) = 0;
61 };
62
64 {
65 public:
67 public:
68 virtual void clear_filter() = 0;
69 virtual void set_filter(shader_filter aFilter, scalar aArgument1 = 0.0, scalar aArgument2 = 0.0, scalar aArgument3 = 0.0, scalar aArgument4 = 0.0) = 0;
70 };
71
73 {
74 public:
76 public:
77 virtual void clear_glyph() = 0;
78 virtual void set_first_glyph(const i_rendering_context& aContext, const glyph_text& aText, const glyph_char& aGlyphChar) = 0;
79 };
80
82 {
83 public:
85 public:
86 virtual bool stipple_active() const = 0;
87 virtual void clear_stipple() = 0;
88 virtual void set_stipple(scalar aFactor, uint16_t aPattern, scalar aPosition = 0.0) = 0;
89 virtual void start(const i_rendering_context& aContext, const vec3& aFrom) = 0;
90 virtual void next(const i_rendering_context& aContext, const vec3& aFrom, scalar aPositionOffset) = 0;
91 };
92
94 {
95 public:
97 public:
98 virtual bool shape_active() const = 0;
99 virtual void clear_shape() = 0;
100 virtual void set_shape(shader_shape aShape) = 0;
101 };
102}
virtual void set_filter(shader_filter aFilter, scalar aArgument1=0.0, scalar aArgument2=0.0, scalar aArgument3=0.0, scalar aArgument4=0.0)=0
virtual void clear_filter()=0
virtual void clear_glyph()=0
virtual void set_first_glyph(const i_rendering_context &aContext, const glyph_text &aText, const glyph_char &aGlyphChar)=0
virtual void set_gradient(i_rendering_context &aContext, const gradient &aGradient)=0
virtual void set_gradient(i_rendering_context &aContext, const game::gradient &aGradient)=0
virtual void clear_gradient()=0
virtual void set_shape(shader_shape aShape)=0
virtual bool shape_active() const =0
virtual void clear_shape()=0
virtual void clear_stipple()=0
virtual void set_stipple(scalar aFactor, uint16_t aPattern, scalar aPosition=0.0)=0
virtual void next(const i_rendering_context &aContext, const vec3 &aFrom, scalar aPositionOffset)=0
virtual void start(const i_rendering_context &aContext, const vec3 &aFrom)=0
virtual bool stipple_active() const =0
virtual void set_texture(const i_texture &aTexture)=0
virtual void clear_texture()=0
virtual void set_effect(shader_effect aEffect)=0
double scalar
Definition numerical.hpp:63