diff options
author | Sven Gothel <[email protected]> | 2011-05-16 03:30:33 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-05-16 03:30:33 +0200 |
commit | f3de07e479c7849d0172a03bb82ce9189da5679e (patch) | |
tree | 03d50949920ceeb58ee6214687d2837b926c240e | |
parent | 2f89bf30607281bb8dc0a07b185fa403b9b0f093 (diff) |
Fix ShaderState useProgram() case: on && program not linked (yet)
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java index e51998a87..d0de473b4 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java @@ -148,13 +148,17 @@ public class ShaderState { resetAllAttributes(gl); resetAllUniforms(gl); } - } else if(resetAllShaderData) { - setAllAttributes(gl); + } else { + if(resetAllShaderData) { + setAllAttributes(gl); + } if(!shaderProgram.link(gl, System.err)) { throw new GLException("could not link program: "+shaderProgram); } shaderProgram.useProgram(gl, true); - resetAllUniforms(gl); + if(resetAllShaderData) { + resetAllUniforms(gl); + } } resetAllShaderData = false; } else { |