summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-08-21 13:42:48 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2022-08-21 13:42:48 +0100
commit5694a281e3efc13a62dc43ced9c7459724d01b23 (patch)
tree4fcaba562171e6e661e2050895782501bb71f5d8 /gfx
parentSuppress redundantPointerOp cppcheck (diff)
downloadilt-5694a281e3efc13a62dc43ced9c7459724d01b23.tar.bz2
ilt-5694a281e3efc13a62dc43ced9c7459724d01b23.tar.xz
ilt-5694a281e3efc13a62dc43ced9c7459724d01b23.zip
Reduce variable scope
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/glSource.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gfx/gl/glSource.cpp b/gfx/gl/glSource.cpp
index 49773d0..962d096 100644
--- a/gfx/gl/glSource.cpp
+++ b/gfx/gl/glSource.cpp
@@ -18,7 +18,6 @@ void
GLsource::CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage)
{
GLint success = 0;
- std::array<GLchar, 1024> error {};
if (isProgram) {
glGetProgramiv(shader, flag, &success);
@@ -28,6 +27,7 @@ GLsource::CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::stri
}
if (success == GL_FALSE) {
+ std::array<GLchar, 1024> error {};
if (isProgram) {
glGetProgramInfoLog(shader, error.size(), nullptr, error.data());
}