aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-15 03:34:01 +0100
committerSven Gothel <[email protected]>2023-03-15 03:34:01 +0100
commitb3fe96b2916eb0359412aa8e57a9b1a9577f247d (patch)
tree935af7231635166257ecc7a98f8e6cf4ff7083f7 /src/jogl
parent6ab750aa0b3b3d5be8c8f3a6388faea9149c5765 (diff)
ShaderProgram field programLinked: Set to false @ release()/destroy(), On useProgram() only throw exception if 'on==true' is requested (disabling after delettion is OK)
Diffstat (limited to 'src/jogl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
index 82486a213..fcc1cadd0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
@@ -103,6 +103,7 @@ public final class ShaderProgram {
gl.glDeleteProgram(shaderProgram);
shaderProgram=0;
}
+ programLinked=false;
}
//
@@ -308,7 +309,10 @@ public final class ShaderProgram {
}
public synchronized void useProgram(final GL2ES2 gl, boolean on) {
- if(!programLinked) { throw new GLException("Program is not linked"); }
+ if(on && !programLinked) {
+ System.err.println("Error: ShaderProgram.useProgram(on "+on+") not linked: "+this);
+ throw new GLException("Program is not linked");
+ }
if(programInUse==on) { return; }
if( 0 == shaderProgram ) {
on = false;