summaryrefslogtreecommitdiff
path: root/gfx/gl/shader.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-15 17:47:56 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-15 17:47:56 +0000
commitf2c5923f005a3e22ddc12a4bb700d838f470bb1d (patch)
tree8fffc7af4951512c3e281670415f47afc2ca609b /gfx/gl/shader.h
parentAdd some tests over the behaviour of windows and contexts and glStuff (diff)
downloadilt-f2c5923f005a3e22ddc12a4bb700d838f470bb1d.tar.bz2
ilt-f2c5923f005a3e22ddc12a4bb700d838f470bb1d.tar.xz
ilt-f2c5923f005a3e22ddc12a4bb700d838f470bb1d.zip
Shaders can be deleted once attached to a program
Diffstat (limited to 'gfx/gl/shader.h')
-rw-r--r--gfx/gl/shader.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/gfx/gl/shader.h b/gfx/gl/shader.h
index 1a8ddef..a20636d 100644
--- a/gfx/gl/shader.h
+++ b/gfx/gl/shader.h
@@ -7,15 +7,14 @@
class Shader {
public:
+ using ShaderRef = glRef<GLuint, &__glewCreateShader, &__glewDeleteShader>;
constexpr Shader(const GLchar * text, GLint len, GLuint type) : text {text}, len {len}, type {type} { }
- operator GLuint() const;
+ ShaderRef compile() const;
static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage);
private:
- using ShaderRef = glRef<GLuint, &__glewCreateShader, &__glewDeleteShader>;
const GLchar * text;
GLint len;
GLuint type;
- mutable std::optional<ShaderRef> shader {};
};