From c37c96ce30b7fcdbaf9d6b682729edb43a139d0d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 19 Mar 2023 07:14:57 +0100 Subject: Graph: Add RegionRenderer.enable(..) variant w/ passing enable + disable GLCallback --- .../com/jogamp/graph/curve/opengl/RegionRenderer.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 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 3c14b1bab..28be06eee 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java @@ -336,13 +336,24 @@ public final class RegionRenderer { * @see RenderState#getShaderProgram() */ public final void enable(final GL2ES2 gl, final boolean enable) { + enable(gl, enable, enableCallback, disableCallback); + } + + /** + * Same as {@link #enable(GL2ES2, boolean)} but allowing to force {@link GLCallback}s off. + * @param gl current GL object + * @param enable if true enable the current {@link ShaderProgram}, otherwise disable. + * @param doCallbacks if true (default) perform {@link GLCallback}s, otherwise don't. + * @see #enable(GL2ES2, boolean) + */ + public final void enable(final GL2ES2 gl, final boolean enable, final GLCallback enableCB, final GLCallback disableCB) { if( enable ) { - if( null != enableCallback ) { - enableCallback.run(gl, this); + if( null != enableCB ) { + enableCB.run(gl, this); } } else { - if( null != disableCallback ) { - disableCallback.run(gl, this); + if( null != disableCB ) { + disableCB.run(gl, this); } } if( !enable ) { -- cgit v1.2.3