From d4ae68b6ba5211c7bc11a52951c466c5050ae377 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 21 Jan 2024 01:34:10 +0000 Subject: String view/constexpr Shader instances Gonna need more constexpr stuff and strstr/strlen aren't that --- gfx/gl/shader.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gfx/gl/shader.h') diff --git a/gfx/gl/shader.h b/gfx/gl/shader.h index cff2281..cc1bbc0 100644 --- a/gfx/gl/shader.h +++ b/gfx/gl/shader.h @@ -2,20 +2,18 @@ #include #include -#include #include class Shader { public: using ShaderRef = glRef; - constexpr Shader(const GLchar * text, GLint len, GLuint type) : text {text}, len {len}, type {type} { } + constexpr Shader(const GLchar * text, GLuint type) : text {text}, type {type} { } [[nodiscard]] ShaderRef compile() const; static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage); private: - const GLchar * text; - GLint len; + const std::basic_string_view text; GLuint type; }; -- cgit v1.2.3