diff options
author | Sven Gothel <[email protected]> | 2023-03-13 21:38:29 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-13 21:38:29 +0100 |
commit | 67a723477ecd818fbc5859fe20ee536a3b4efae5 (patch) | |
tree | ca9ad9fa7b45c1fb99ce153667af64d13f73bc0c /src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java | |
parent | 6feb3738231210b03edefa7a60cf11e644fb7a5d (diff) |
GLRegion + RegionRenderer: Add clearShader(..) to delete all ShaderPrograms and is references.
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java index 57f9a69d8..a86060fab 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java @@ -39,6 +39,7 @@ import jogamp.graph.curve.opengl.VBORegion2PVBAAES2; import jogamp.graph.curve.opengl.VBORegionSPES2;
import com.jogamp.opengl.util.PMVMatrix;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
import com.jogamp.opengl.util.texture.TextureSequence;
import com.jogamp.graph.curve.Region;
import com.jogamp.graph.font.Font;
@@ -178,6 +179,7 @@ public abstract class GLRegion extends Region { */
protected abstract void updateImpl(final GL2ES2 gl);
+ protected abstract void clearShaderImpl(final GL2ES2 gl);
protected abstract void destroyImpl(final GL2ES2 gl);
protected abstract void clearImpl(final GL2ES2 gl);
@@ -210,10 +212,16 @@ public abstract class GLRegion extends Region { return this;
}
+ /** Deletes all {@link ShaderProgram}s and nullifies its references. */
+ public final void clearShader(final GL2ES2 gl) {
+ clearShaderImpl(gl);
+ }
+
/**
* Delete and clear the associated OGL objects.
*/
public final void destroy(final GL2ES2 gl) {
+ clearShaderImpl(gl);
clear(gl);
destroyImpl(gl);
}
|