summaryrefslogtreecommitdiffstats
path: root/src/net/java/joglutils/msg/nodes/ShaderNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/joglutils/msg/nodes/ShaderNode.java')
-rw-r--r--src/net/java/joglutils/msg/nodes/ShaderNode.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net/java/joglutils/msg/nodes/ShaderNode.java b/src/net/java/joglutils/msg/nodes/ShaderNode.java
index 676838e..c066079 100644
--- a/src/net/java/joglutils/msg/nodes/ShaderNode.java
+++ b/src/net/java/joglutils/msg/nodes/ShaderNode.java
@@ -441,6 +441,18 @@ public class ShaderNode extends Node {
}
}
+ /** Resets the OpenGL state of this node without explicitly
+ disposing of any resources. This should only be called when you
+ know you are using this ShaderNode across the destruction and
+ re-creation of OpenGL contexts and know how to re-initialize the
+ ShaderNode from its previous state. */
+ public void resetGL(GLResetAction action) {
+ disposeShader();
+ synchronized(this) {
+ disposedShaders.clear();
+ }
+ }
+
private synchronized void disposeShader() {
if (shader != null) {
disposedShaders.add(shader);