summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-08-01 17:46:27 +0200
committerSven Gothel <[email protected]>2023-08-01 17:46:27 +0200
commit285459363469e60df9db51a4c0485ec21d4e04ae (patch)
tree6c39bd4c3db123a43907e9722a208aff82d579cb /src/jogl/classes/com
parenta973324a75b55b722caa755a7a573be849d997e4 (diff)
Graph RegionRendered.init(..): Disable renderer (and shader programs etc) to avoid side-effects. Usually called @ GLEventListener.init(..)
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
index 147edaee9..6e5cd1487 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -238,8 +238,8 @@ public final class RegionRenderer {
/**
* Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext
* if not initialized yet.
- * <p>Leaves the renderer enabled, ie ShaderState.</p>
- * <p>Shall be called by a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, int)}</p>
+ * <p>Disables the renderer via {@link #enable(GL2ES2, boolean)} to remove any side-effects, ie ShaderState incl. shader program.</p>
+ * <p>Shall be called once before at initialization before a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, int)}</p>
*
* @param gl referencing the current GLContext to which the ShaderState is bound to
* @throws GLException if initialization failed
@@ -265,10 +265,8 @@ public final class RegionRenderer {
rs.attachTo(gl);
- if( null != enableCallback ) {
- enableCallback.run(gl, this);
- }
initialized = true;
+ enable(gl, false);
}
/** Deletes all {@link ShaderProgram}s and nullifies its references including {@link RenderState#destroy(GL2ES2)}. */