summaryrefslogtreecommitdiff
path: root/gfx/gl/shader.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-21 01:34:10 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-21 01:34:10 +0000
commitd4ae68b6ba5211c7bc11a52951c466c5050ae377 (patch)
treede9d06beede1d7baaf868b6f6c32d3e3c90c5fb3 /gfx/gl/shader.h
parentFix includes in test glCtxtBhvr (diff)
downloadilt-d4ae68b6ba5211c7bc11a52951c466c5050ae377.tar.bz2
ilt-d4ae68b6ba5211c7bc11a52951c466c5050ae377.tar.xz
ilt-d4ae68b6ba5211c7bc11a52951c466c5050ae377.zip
String view/constexpr Shader instances
Gonna need more constexpr stuff and strstr/strlen aren't that
Diffstat (limited to 'gfx/gl/shader.h')
-rw-r--r--gfx/gl/shader.h6
1 files changed, 2 insertions, 4 deletions
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 <glRef.h>
#include <glad/gl.h>
-#include <optional>
#include <string_view>
class Shader {
public:
using ShaderRef = glRef<GLuint, &glCreateShader, &glDeleteShader>;
- 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<GLchar> text;
GLuint type;
};