@Test public final void testDepthClamp() { final Interfaces i = this.getInterfaces("main", 24, 8); final JCGLDepthBuffersType g_dep = i.getDepthBuffers(); Assert.assertFalse(g_dep.depthClampingIsEnabled()); g_dep.depthClampingEnable(); Assert.assertTrue(g_dep.depthClampingIsEnabled()); g_dep.depthClampingDisable(); Assert.assertFalse(g_dep.depthClampingIsEnabled()); }
@Test public final void testDepthClamp() { final Interfaces i = this.getInterfaces("main", 24, 8); final JCGLDepthBuffersType g_dep = i.getDepthBuffers(); Assert.assertFalse(g_dep.depthClampingIsEnabled()); g_dep.depthClampingEnable(); Assert.assertTrue(g_dep.depthClampingIsEnabled()); g_dep.depthClampingDisable(); Assert.assertFalse(g_dep.depthClampingIsEnabled()); }
@Test public final void testNoDepthNoFramebufferClampIsEnabled() { final Interfaces i = this.getInterfaces("main", 0, 0); final JCGLDepthBuffersType g_dep = i.getDepthBuffers(); this.expected.expect(JCGLExceptionNoDepthBuffer.class); g_dep.depthClampingIsEnabled(); }
@Test public final void testNoDepthNoFramebufferClampIsEnabled() { final Interfaces i = this.getInterfaces("main", 0, 0); final JCGLDepthBuffersType g_dep = i.getDepthBuffers(); this.expected.expect(JCGLExceptionNoDepthBuffer.class); g_dep.depthClampingIsEnabled(); }
@Test public final void testNoDepthFramebufferClampIsEnabled() { final Interfaces i = this.getInterfaces("main", 24, 8); final JCGLDepthBuffersType g_dep = i.getDepthBuffers(); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tex = i.getTextures(); final JCGLFramebufferType fb = depthlessFramebuffer(g_fb, g_tex); Assert.assertTrue(g_fb.framebufferDrawIsBound(fb)); this.expected.expect(JCGLExceptionNoDepthBuffer.class); g_dep.depthClampingIsEnabled(); }
@Test public final void testNoDepthFramebufferClampIsEnabled() { final Interfaces i = this.getInterfaces("main", 24, 8); final JCGLDepthBuffersType g_dep = i.getDepthBuffers(); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tex = i.getTextures(); final JCGLFramebufferType fb = JCGLDepthBuffersContract.depthlessFramebuffer(g_fb, g_tex); Assert.assertTrue(g_fb.framebufferDrawIsBound(fb)); this.expected.expect(JCGLExceptionNoDepthBuffer.class); g_dep.depthClampingIsEnabled(); }
@Test public final void testDepthTestWriteNonStrict() { final JCGLInterfaceGL33Type g = this.getGL33("main", 24, 8); final JCGLRenderStateMutable r = JCGLRenderStateMutable.create(); final JCGLDepthStateMutable ds = JCGLDepthStateMutable.create(); ds.setDepthStrict(JCGLDepthStrict.DEPTH_STRICT_DISABLED); ds.setDepthClamp(JCGLDepthClamping.DEPTH_CLAMP_ENABLED); ds.setDepthTest(Optional.of(JCGLDepthFunction.DEPTH_EQUAL)); ds.setDepthWrite(JCGLDepthWriting.DEPTH_WRITE_ENABLED); r.setDepthState(ds); JCGLRenderStates.activate(g, r); final JCGLDepthBuffersType g_d = g.getDepthBuffers(); Assert.assertTrue(g_d.depthBufferTestIsEnabled()); Assert.assertTrue(g_d.depthBufferWriteIsEnabled()); Assert.assertTrue(g_d.depthClampingIsEnabled()); }
@Test public final void testDepthTestWriteStrict() { final JCGLInterfaceGL33Type g = this.getGL33("main", 24, 8); final JCGLRenderStateMutable r = JCGLRenderStateMutable.create(); final JCGLDepthStateMutable ds = JCGLDepthStateMutable.create(); ds.setDepthStrict(JCGLDepthStrict.DEPTH_STRICT_ENABLED); ds.setDepthClamp(JCGLDepthClamping.DEPTH_CLAMP_ENABLED); ds.setDepthTest(Optional.of(JCGLDepthFunction.DEPTH_EQUAL)); ds.setDepthWrite(JCGLDepthWriting.DEPTH_WRITE_ENABLED); r.setDepthState(ds); JCGLRenderStates.activate(g, r); final JCGLDepthBuffersType g_d = g.getDepthBuffers(); Assert.assertTrue(g_d.depthBufferTestIsEnabled()); Assert.assertTrue(g_d.depthBufferWriteIsEnabled()); Assert.assertTrue(g_d.depthClampingIsEnabled()); }
@Test public final void testDepthTestWriteStrict() { final JCGLInterfaceGL33Type g = this.getGL33("main", 24, 8); final JCGLRenderStateMutable r = JCGLRenderStateMutable.create(); final JCGLDepthStateMutable ds = JCGLDepthStateMutable.create(); ds.setDepthStrict(JCGLDepthStrict.DEPTH_STRICT_ENABLED); ds.setDepthClamp(JCGLDepthClamping.DEPTH_CLAMP_ENABLED); ds.setDepthTest(Optional.of(JCGLDepthFunction.DEPTH_EQUAL)); ds.setDepthWrite(JCGLDepthWriting.DEPTH_WRITE_ENABLED); r.setDepthState(ds); JCGLRenderStates.activate(g, r); final JCGLDepthBuffersType g_d = g.depthBuffers(); Assert.assertTrue(g_d.depthBufferTestIsEnabled()); Assert.assertTrue(g_d.depthBufferWriteIsEnabled()); Assert.assertTrue(g_d.depthClampingIsEnabled()); }
@Test public final void testDepthTestWriteNonStrict() { final JCGLInterfaceGL33Type g = this.getGL33("main", 24, 8); final JCGLRenderStateMutable r = JCGLRenderStateMutable.create(); final JCGLDepthStateMutable ds = JCGLDepthStateMutable.create(); ds.setDepthStrict(JCGLDepthStrict.DEPTH_STRICT_DISABLED); ds.setDepthClamp(JCGLDepthClamping.DEPTH_CLAMP_ENABLED); ds.setDepthTest(Optional.of(JCGLDepthFunction.DEPTH_EQUAL)); ds.setDepthWrite(JCGLDepthWriting.DEPTH_WRITE_ENABLED); r.setDepthState(ds); JCGLRenderStates.activate(g, r); final JCGLDepthBuffersType g_d = g.depthBuffers(); Assert.assertTrue(g_d.depthBufferTestIsEnabled()); Assert.assertTrue(g_d.depthBufferWriteIsEnabled()); Assert.assertTrue(g_d.depthClampingIsEnabled()); }
@Test public final void testInitialState() { final JCGLInterfaceGL33Type g = this.getGL33("main", 24, 8); final JCGLRenderStateMutable r = JCGLRenderStateMutable.create(); JCGLRenderStates.activate(g, r); final JCGLBlendingType g_b = g.blending(); final JCGLCullingType g_c = g.culling(); final JCGLDepthBuffersType g_d = g.depthBuffers(); final JCGLColorBufferMaskingType g_cm = g.colorBufferMasking(); final JCGLPolygonModesType g_p = g.polygonModes(); final JCGLScissorType g_s = g.scissor(); Assert.assertFalse(g_b.blendingIsEnabled()); Assert.assertFalse(g_c.cullingIsEnabled()); Assert.assertTrue(g_cm.colorBufferMaskStatusRed()); Assert.assertTrue(g_cm.colorBufferMaskStatusGreen()); Assert.assertTrue(g_cm.colorBufferMaskStatusBlue()); Assert.assertTrue(g_cm.colorBufferMaskStatusAlpha()); Assert.assertFalse(g_d.depthBufferTestIsEnabled()); Assert.assertFalse(g_d.depthBufferWriteIsEnabled()); Assert.assertFalse(g_d.depthClampingIsEnabled()); Assert.assertEquals(JCGLPolygonMode.POLYGON_FILL, g_p.polygonGetMode()); Assert.assertFalse(g_s.scissorIsEnabled()); }
@Test public final void testInitialState() { final JCGLInterfaceGL33Type g = this.getGL33("main", 24, 8); final JCGLRenderStateMutable r = JCGLRenderStateMutable.create(); JCGLRenderStates.activate(g, r); final JCGLBlendingType g_b = g.getBlending(); final JCGLCullingType g_c = g.getCulling(); final JCGLDepthBuffersType g_d = g.getDepthBuffers(); final JCGLColorBufferMaskingType g_cm = g.getColorBufferMasking(); final JCGLPolygonModesType g_p = g.getPolygonModes(); final JCGLScissorType g_s = g.getScissor(); Assert.assertFalse(g_b.blendingIsEnabled()); Assert.assertFalse(g_c.cullingIsEnabled()); Assert.assertTrue(g_cm.colorBufferMaskStatusRed()); Assert.assertTrue(g_cm.colorBufferMaskStatusGreen()); Assert.assertTrue(g_cm.colorBufferMaskStatusBlue()); Assert.assertTrue(g_cm.colorBufferMaskStatusAlpha()); Assert.assertFalse(g_d.depthBufferTestIsEnabled()); Assert.assertFalse(g_d.depthBufferWriteIsEnabled()); Assert.assertFalse(g_d.depthClampingIsEnabled()); Assert.assertEquals(JCGLPolygonMode.POLYGON_FILL, g_p.polygonGetMode()); Assert.assertFalse(g_s.scissorIsEnabled()); }