diff options
author | chai <chaifix@163.com> | 2019-01-01 23:20:53 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-01-01 23:20:53 +0800 |
commit | 435a1f782415b50c187bac8dea01ffbcd6856034 (patch) | |
tree | ac86bb7eaae3eb213d51d4fa40ccc1487e5895b9 /src | |
parent | 6f8c70f5846222aea15d2b27ea5192fdec018781 (diff) |
*misc
Diffstat (limited to 'src')
-rw-r--r-- | src/libjin/graphics/shaders/je_shader.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/libjin/graphics/shaders/je_shader.cpp b/src/libjin/graphics/shaders/je_shader.cpp index 4fa3b9e..6235128 100644 --- a/src/libjin/graphics/shaders/je_shader.cpp +++ b/src/libjin/graphics/shaders/je_shader.cpp @@ -89,7 +89,9 @@ namespace JinEngine sendVec2(SHADER_RENDERTARGET_SIZE, rt->getWidth(), rt->getHeight()); } // Reset attribute index. - mAttributeIndex = 0; + for(; mAttributeIndex > 0; --mAttributeIndex) + glDisableVertexAttribArray(mAttributeIndex); + return *this; } @@ -103,15 +105,15 @@ namespace JinEngine return false; } - #define glsl(SHADER_MODE, SHADER, SRC) \ - do{ \ - const GLchar* src = SRC.c_str(); \ - glShaderSource(SHADER, 1, &src, NULL); \ - glCompileShader(SHADER); \ - GLint success; \ - glGetShaderiv(SHADER, GL_COMPILE_STATUS, &success); \ - if (success == GL_FALSE) \ - return false; \ + #define glsl(SHADER_MODE, SHADER, SRC) \ + do{ \ + const GLchar* src = SRC.c_str(); \ + glShaderSource(SHADER, 1, &src, NULL); \ + glCompileShader(SHADER); \ + GLint success; \ + glGetShaderiv(SHADER, GL_COMPILE_STATUS, &success); \ + if (success == GL_FALSE) \ + return false; \ }while(0) // Compile vertex shader. |