diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-21 01:34:10 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-21 01:34:10 +0000 |
commit | d4ae68b6ba5211c7bc11a52951c466c5050ae377 (patch) | |
tree | de9d06beede1d7baaf868b6f6c32d3e3c90c5fb3 /gfx/gl/shader.cpp | |
parent | Fix includes in test glCtxtBhvr (diff) | |
download | ilt-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.cpp')
-rw-r--r-- | gfx/gl/shader.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gfx/gl/shader.cpp b/gfx/gl/shader.cpp index 5f83b83..285c2c3 100644 --- a/gfx/gl/shader.cpp +++ b/gfx/gl/shader.cpp @@ -7,7 +7,10 @@ Shader::ShaderRef Shader::compile() const { ShaderRef shader {type}; - glShaderSource(shader, 1, &text, &len); + auto source = [&shader](auto text, GLint len) { + glShaderSource(shader, 1, &text, &len); + }; + source(text.data(), static_cast<GLint>(text.length())); glCompileShader(shader); CheckShaderError(shader, GL_COMPILE_STATUS, false, "Error compiling shader!"); |