summaryrefslogtreecommitdiff
path: root/gfx/gl/shader.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-08-04 13:10:15 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-08-04 13:10:15 +0100
commit3fe690f2d64c4e8ce525da1c9732b7f3aa6fe370 (patch)
tree79776f9e3c7a76454aa883ed685643198eb54c30 /gfx/gl/shader.h
parentHelp exception class for lazy/cached message content (diff)
downloadilt-3fe690f2d64c4e8ce525da1c9732b7f3aa6fe370.tar.bz2
ilt-3fe690f2d64c4e8ce525da1c9732b7f3aa6fe370.tar.xz
ilt-3fe690f2d64c4e8ce525da1c9732b7f3aa6fe370.zip
Specific exception for shader compile error
Outputs more details, including shader source
Diffstat (limited to 'gfx/gl/shader.h')
-rw-r--r--gfx/gl/shader.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gfx/gl/shader.h b/gfx/gl/shader.h
index 1e4a2ee..ce97734 100644
--- a/gfx/gl/shader.h
+++ b/gfx/gl/shader.h
@@ -7,6 +7,7 @@
class Shader {
public:
+ using Source = std::basic_string_view<GLchar>;
using ShaderRef = glRef<GLuint, &glCreateShader, &glDeleteShader>;
constexpr Shader(const GLchar * text, GLuint type) :
@@ -16,10 +17,11 @@ public:
[[nodiscard]] ShaderRef compile() const;
+ [[nodiscard]] static GLint getShaderParam(GLuint shader, GLenum pname);
+
private:
- using Source = std::basic_string_view<GLchar>;
+ void checkShaderError(GLuint shader) const;
- void checkShaderError(GLuint shader, GLuint flag, std::string_view errorMessage) const;
const Source text;
GLuint type;
bool lookups;