aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-03-14 08:13:42 +0100
committerSven Gothel <[email protected]>2014-03-14 08:13:42 +0100
commite16e974a3e2b38c65355838eeb010954354097d2 (patch)
treee1582436012d80ffddb5a81e6056a5aaa4e7368b /src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
parent70979247aad156418c32959bbf4962f175191ec2 (diff)
Bug 801: Add Frustum support to Region; Misc ..
Region: Add Frustum support, to drop 'out of sight' shapes RenderState: Add hints, e.g. BITHINT_BLENDING_ENABLED, allowing user code to toggle background color etc Demos: Incomplete - WIP - Reuse mapped object to window coords computed at reshape - TODO: Use minimal Scenegraph for Graph-UI ..
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java18
1 files changed, 13 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 1f6e532d3..bff7c905f 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -62,27 +62,35 @@ public abstract class RegionRenderer {
* Default {@link GL#GL_BLEND} <i>enable</i> {@link GLCallback},
* turning on the {@link GL#GL_BLEND} state and setting up
* {@link GL#glBlendFunc(int, int) glBlendFunc}({@link GL#GL_SRC_ALPHA}, {@link GL#GL_ONE_MINUS_SRC_ALPHA}).
- * @see #setEnableCallback(GLCallback, GLCallback)
+ * <p>
+ * Implementation also sets {@link RegionRenderer#getRenderState() RenderState}'s {@link RenderState#BITHINT_BLENDING_ENABLED blending bit-hint}.
+ * </p>
+ * @see #create(RenderState, int, GLCallback, GLCallback)
* @see #enable(GL2ES2, boolean)
*/
public static final GLCallback defaultBlendEnable = new GLCallback() {
@Override
- public void run(final GL gl, final RegionRenderer args) {
+ public void run(final GL gl, final RegionRenderer renderer) {
gl.glEnable(GL.GL_BLEND);
gl.glBlendEquation(GL.GL_FUNC_ADD); // default
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
+ renderer.rs.setHintBits(RenderState.BITHINT_BLENDING_ENABLED);
}
};
/**
* Default {@link GL#GL_BLEND} <i>disable</i> {@link GLCallback},
* simply turning off the {@link GL#GL_BLEND} state.
- * @see #setEnableCallback(GLCallback, GLCallback)
+ * <p>
+ * Implementation also clears {@link RegionRenderer#getRenderState() RenderState}'s {@link RenderState#BITHINT_BLENDING_ENABLED blending bit-hint}.
+ * </p>
+ * @see #create(RenderState, int, GLCallback, GLCallback)
* @see #enable(GL2ES2, boolean)
*/
public static final GLCallback defaultBlendDisable = new GLCallback() {
@Override
- public void run(final GL gl, final RegionRenderer args) {
+ public void run(final GL gl, final RegionRenderer renderer) {
+ renderer.rs.clearHintBits(RenderState.BITHINT_BLENDING_ENABLED);
gl.glDisable(GL.GL_BLEND);
}
};
@@ -287,7 +295,7 @@ public abstract class RegionRenderer {
}
- public final void getColorStatic(GL2ES2 gl, float[] rgb) {
+ public final void getColorStatic(float[] rgb) {
FloatBuffer fb = (FloatBuffer) rs.getColorStatic().getBuffer();
rgb[0] = fb.get(0);
rgb[1] = fb.get(1);