From dcdff7828e1dc3b5cbfc10a30ee10c2ffec07987 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 12 Dec 2021 15:33:09 +0000 Subject: Move GL shared source into it's own class/file --- gfx/gl/glSource.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gfx/gl/glSource.h (limited to 'gfx/gl/glSource.h') 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 +#include + +struct GLsource { + using ShaderRef = glRef; + + 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 -- cgit v1.2.3