From f3de07e479c7849d0172a03bb82ce9189da5679e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 16 May 2011 03:30:33 +0200 Subject: Fix ShaderState useProgram() case: on && program not linked (yet) --- src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/com') 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 { -- cgit v1.2.3