diff options
Diffstat (limited to 'gfx/gl/glSource.h')
-rw-r--r-- | gfx/gl/glSource.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gfx/gl/glSource.h b/gfx/gl/glSource.h new file mode 100644 index 0000000..53c221b --- /dev/null +++ b/gfx/gl/glSource.h @@ -0,0 +1,18 @@ +#ifndef SHADER_SOURCE_H +#define SHADER_SOURCE_H + +#include <GL/glew.h> +#include <glRef.hpp> + +struct GLsource { + using ShaderRef = glRef<GLuint, __glewCreateShader, __glewDeleteShader>; + + const GLchar * text; + GLint len; + GLuint type; + + [[nodiscard]] ShaderRef compile() const; + static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage); +}; + +#endif |