#pragma once #include #include #include #include class Shader { public: constexpr Shader(const GLchar * text, GLint len, GLuint type) : text {text}, len {len}, type {type} { } operator GLuint() const; static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage); private: using ShaderRef = glRef; const GLchar * text; GLint len; GLuint type; mutable std::optional shader {}; };