From f2c5923f005a3e22ddc12a4bb700d838f470bb1d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 15 Nov 2022 17:47:56 +0000 Subject: Shaders can be deleted once attached to a program --- gfx/gl/shader.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gfx/gl/shader.h') 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; 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; const GLchar * text; GLint len; GLuint type; - mutable std::optional shader {}; }; -- cgit v1.2.3