neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_vertex_shader.hpp
Go to the documentation of this file.
1// i_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>
26
27namespace neogfx
28{
29 class i_rendering_context;
30
31 class i_vertex_shader : public i_shader
32 {
33 public:
35 public:
37 public:
38 virtual const attribute_map& attributes() const = 0;
39 virtual void clear_attribute(const i_string& aName) = 0;
40 virtual i_shader_variable& add_attribute(const i_string& aName, uint32_t aLocation, bool aFlat, shader_data_type aType) = 0;
41 template <typename T>
42 i_shader_variable& add_attribute(const i_string& aName, shader_variable_location aLocation, bool aFlat = false)
43 {
45 }
46 };
47
49 {
50 public:
51 virtual void set_projection_matrix(const optional_mat44& aProjectionMatrix) = 0;
52 virtual void set_transformation_matrix(const optional_mat44& aProjectionMatrix) = 0;
53 virtual void set_opacity(scalar aOpacity) = 0;
54 };
55}
virtual void set_transformation_matrix(const optional_mat44 &aProjectionMatrix)=0
virtual void set_projection_matrix(const optional_mat44 &aProjectionMatrix)=0
virtual void set_opacity(scalar aOpacity)=0
i_shader_variable & add_attribute(const i_string &aName, shader_variable_location aLocation, bool aFlat=false)
neolib::i_map< i_string, abstract_t< shader_variable > * > attribute_map
virtual void clear_attribute(const i_string &aName)=0
i_vertex_shader abstract_type
virtual i_shader_variable & add_attribute(const i_string &aName, uint32_t aLocation, bool aFlat, shader_data_type aType)=0
virtual const attribute_map & attributes() const =0
shader_data_type
Definition i_shader.hpp:69
double scalar
Definition numerical.hpp:63
ref_ptr< ConcreteType > make_ref(Args &&... args)