aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-02 02:40:23 +0200
committerSven Gothel <[email protected]>2011-09-02 02:40:23 +0200
commit22ff61dab242305bdb91c7c70f9e03291fb5d869 (patch)
treede26883dfda8e512eb18ab4d01970cfb7f9dfc13 /src/test
parent7f670735a6ca5945ab18769c597b80a1d5c86bb6 (diff)
Test GLSLSimpleProgram: Add proper destroy ..
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java b/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
index bcafc02f7..e23c31c23 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
@@ -39,11 +39,13 @@ public class GLSLSimpleProgram {
private int shaderProgram;
private int vertShader;
private int fragShader;
+ private boolean isValid;
private GLSLSimpleProgram(int shaderProgram, int vertShader, int fragShader) {
this.shaderProgram = shaderProgram;
this.vertShader = vertShader;
this.fragShader = fragShader;
+ this.isValid = true;
}
public static GLSLSimpleProgram create(GL2ES2 gl, String vertShaderCode, String fragShaderCode, boolean link) {
@@ -105,6 +107,10 @@ public class GLSLSimpleProgram {
gl.glDetachShader(shaderProgram, fragShader);
gl.glDeleteShader(fragShader);
gl.glDeleteProgram(shaderProgram);
+ isValid = false;
+ shaderProgram = 0;
+ vertShader = 0;
+ fragShader = 0;
}
public int getFragShader() {
@@ -118,4 +124,8 @@ public class GLSLSimpleProgram {
public int getVertShader() {
return vertShader;
}
+
+ public boolean isValid() {
+ return isValid;
+ }
}