summaryrefslogtreecommitdiff
path: root/gfx/gl/glSource.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-12-12 15:33:09 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-12-12 15:48:47 +0000
commitdcdff7828e1dc3b5cbfc10a30ee10c2ffec07987 (patch)
treef2d0e52661d38f389c8686b7b6fcd5afe4efafe8 /gfx/gl/glSource.h
parentMove generic constexpr_strlen to lib (diff)
downloadilt-dcdff7828e1dc3b5cbfc10a30ee10c2ffec07987.tar.bz2
ilt-dcdff7828e1dc3b5cbfc10a30ee10c2ffec07987.tar.xz
ilt-dcdff7828e1dc3b5cbfc10a30ee10c2ffec07987.zip
Move GL shared source into it's own class/file
Diffstat (limited to 'gfx/gl/glSource.h')
-rw-r--r--gfx/gl/glSource.h18
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