diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-21 02:39:30 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-21 02:39:30 +0000 |
commit | 979c226bdcd7904db5bd23dfbf526de4c040f436 (patch) | |
tree | 0ed48aa59aeef2480233b43d5cbe217ccb4fb382 /gfx/gl/shader.h | |
parent | Include ctre submodule (diff) | |
download | ilt-979c226bdcd7904db5bd23dfbf526de4c040f436.tar.bz2 ilt-979c226bdcd7904db5bd23dfbf526de4c040f436.tar.xz ilt-979c226bdcd7904db5bd23dfbf526de4c040f436.zip |
Look for and replace GL_XXX with fixed string
Diffstat (limited to 'gfx/gl/shader.h')
-rw-r--r-- | gfx/gl/shader.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gfx/gl/shader.h b/gfx/gl/shader.h index cc1bbc0..c6b45af 100644 --- a/gfx/gl/shader.h +++ b/gfx/gl/shader.h @@ -3,12 +3,16 @@ #include <glRef.h> #include <glad/gl.h> #include <string_view> +#include <thirdparty/ctre/include/ctre.hpp> class Shader { public: using ShaderRef = glRef<GLuint, &glCreateShader, &glDeleteShader>; - constexpr Shader(const GLchar * text, GLuint type) : text {text}, type {type} { } + constexpr Shader(const GLchar * text, GLuint type) : + text {text}, type {type}, lookups {ctre::search<R"(\bGL_[A-Z_]+\b)">(this->text)} + { + } [[nodiscard]] ShaderRef compile() const; static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage); @@ -16,4 +20,5 @@ public: private: const std::basic_string_view<GLchar> text; GLuint type; + bool lookups; }; |