diff options
author | Sven Gothel <[email protected]> | 2014-04-10 00:31:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-04-10 00:31:52 +0200 |
commit | 45395696c252c215a8a22d05e5da7e98c662d07e (patch) | |
tree | 952c132450f7cc56aeed0bb1fc040bde5f3ba96a /src/test/com/jogamp | |
parent | 16324b8f8369379ab4db013c4785a496b25c7094 (diff) |
Bug 801: Introd. RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED hinting to deal w/ GL_DEPTH_TEST accordingly
Fixes VBORegion2PMSAAES2 no-depth-buffer usage
and allows user to control behavior w/o quering GL state.
If BITHINT_GLOBAL_DEPTH_TEST_ENABLED set:
- RegionRenderer.defaultBlendEnable: glDepthMask(false)
- RegionRenderer.defaultBlendDisable: glDepthMask(true)
- VBORegion2PMSAAES2 enables/disables GL_DEPTH_TEST, otherwise MSAA is corrupt.
Diffstat (limited to 'src/test/com/jogamp')
6 files changed, 6 insertions, 0 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java index ad794b646..0235a78c2 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java @@ -141,6 +141,7 @@ public class TestTextRendererNEWT10 extends UITestCase { final RenderState rs = RenderState.createRenderState(SVertex.factory()); final RegionRenderer renderer = RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable); + rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED); final TextRegionUtil textRenderUtil = new TextRegionUtil(0); // init diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java index 127cf3fc3..ebd526899 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java @@ -136,6 +136,7 @@ public abstract class TextRendererGLELBase implements GLEventListener { this.rs = RenderState.createRenderState(SVertex.factory(), sharedPMVMatrix); } this.renderer = RegionRenderer.create(rs, enableCallback, disableCallback); + rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED); this.textRenderUtil = new TextRegionUtil(renderModes); final GL2ES2 gl = drawable.getGL().getGL2ES2(); renderer.init(gl, renderModes); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java index 48ba148a9..4bcbdb380 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java @@ -51,6 +51,7 @@ public class GPURegionGLListener01 extends GPURendererListenerBase01 { public GPURegionGLListener01 (RenderState rs, int renderModes, int sampleCount, boolean debug, boolean trace) { super(RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), renderModes, debug, trace); + rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED); setMatrix(-20, 00, -50, 0f, sampleCount); } diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java index 374f2928c..ca9f4fda7 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java @@ -51,6 +51,7 @@ public class GPURegionGLListener02 extends GPURendererListenerBase01 { public GPURegionGLListener02 (RenderState rs, int renderModes, int sampleCount, boolean debug, boolean trace) { super(RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), renderModes, debug, trace); + rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED); setMatrix(-20, 00, -50, 0f, sampleCount); } diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java index ad12e11e1..891151e38 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java @@ -116,6 +116,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB super(RegionRenderer.create(rs, blending ? RegionRenderer.defaultBlendEnable : null, blending ? RegionRenderer.defaultBlendDisable : null), renderModes, debug, trace); + rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED); this.textRegionUtil = new TextRegionUtil(renderModes); this.regionFPS = GLRegion.create(renderModes, null); this.regionBottom = GLRegion.create(renderModes, null); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java index 2dcad1e86..df9c6381f 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java @@ -615,6 +615,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { } renderer = RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable); + rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED); // renderer = RegionRenderer.create(rs, null, null); gl.setSwapInterval(1); |