From 22ff61dab242305bdb91c7c70f9e03291fb5d869 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 2 Sep 2011 02:40:23 +0200 Subject: Test GLSLSimpleProgram: Add proper destroy .. --- .../com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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; + } } -- cgit v1.2.3