From 285459363469e60df9db51a4c0485ec21d4e04ae Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 1 Aug 2023 17:46:27 +0200 Subject: Graph RegionRendered.init(..): Disable renderer (and shader programs etc) to avoid side-effects. Usually called @ GLEventListener.init(..) --- .../classes/com/jogamp/graph/curve/opengl/RegionRenderer.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/jogl/classes/com/jogamp') 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. - *

Leaves the renderer enabled, ie ShaderState.

- *

Shall be called by a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, int)}

+ *

Disables the renderer via {@link #enable(GL2ES2, boolean)} to remove any side-effects, ie ShaderState incl. shader program.

+ *

Shall be called once before at initialization before a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, int)}

* * @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)}. */ -- cgit v1.2.3