#ifndef SHADER_INCLUDED_H #define SHADER_INCLUDED_H #include #include #include #include #include class Shader { public: enum class Program { Basic = 0, Water = 1, LandMass = 2 }; Shader(); void setView(glm::mat4 view) const; void setModel(glm::mat4 model, Program = Program::Basic) const; void setUniform(const GLchar *, glm::vec3 dir) const; private: class Source { public: using ShaderRef = glRef; Source(const std::basic_string_view text, GLuint type); Source(const GLchar * text, GLint len, GLuint type); ShaderRef id; }; static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage); class ProgramHandle { public: ProgramHandle(std::initializer_list); using ProgramRef = glRef; ProgramRef m_program; GLint viewProjection_uniform, model_uniform; }; std::array programs; }; #endif