3 #include <Engine/RaEngine.hpp>
18 enum ShaderType : uint {
19 ShaderType_VERTEX = 0,
22 ShaderType_TESS_CONTROL,
23 ShaderType_TESS_EVALUATION,
79 const std::string& vertexShader,
80 const std::string& fragmentShader );
87 void addShader( ShaderType type,
const std::string& name );
96 void addShaderSource( ShaderType type,
const std::string& source );
101 void addProperty(
const std::string& prop );
102 void addProperties(
const std::list<std::string>& props );
103 void removeProperty(
const std::string& prop );
108 void addInclude(
const std::string& incl, ShaderType type = ShaderType_FRAGMENT );
109 void addIncludes(
const std::list<std::string>& incls, ShaderType type = ShaderType_FRAGMENT );
110 void removeInclude(
const std::string& incl, ShaderType type = ShaderType_FRAGMENT );
113 void addNamedString(
const std::string& includepath,
const std::string& realfile );
118 bool isComplete()
const;
122 std::set<std::string> getProperties()
const;
124 const std::vector<std::pair<std::string, ShaderType>>& getIncludes()
const;
126 const std::vector<std::pair<std::string, std::string>>& getNamedStrings()
const;
131 void setVersion(
const std::string& version ) { m_version = version; }
132 void setName(
const std::string& name ) { m_name = name; }
134 const std::string& getName()
const {
return m_name; }
135 const std::string& getVersion()
const {
return m_version; }
136 friend std::ostream& operator<<( std::ostream& stream,
const ShaderConfiguration& config );
139 std::string m_name {};
140 std::string m_version {};
144 std::array<std::pair<std::string, bool>, ShaderType_COUNT> m_shaders;
146 std::set<std::string> m_properties;
148 std::vector<std::pair<std::string, ShaderType>> m_includes;
150 std::vector<std::pair<std::string, std::string>> m_named_strings;
154 static std::string s_glslVersion;
161 static void setOpenGLVersion(
const glbinding::Version& version );
167 static std::string getGLSLVersion();