@Test public final void testCullingIdentities() { final JCGLCullingType g_c = this.getCulling("main"); Assert.assertFalse(g_c.cullingIsEnabled()); for (final JCGLFaceSelection s : JCGLFaceSelection.values()) { for (final JCGLFaceWindingOrder w : JCGLFaceWindingOrder.values()) { g_c.cullingEnable(s, w); Assert.assertTrue(g_c.cullingIsEnabled()); g_c.cullingDisable(); Assert.assertFalse(g_c.cullingIsEnabled()); } } } }
private static void configureCulling( final JCGLInterfaceGL33Type g, final JCGLRenderStateType r) { final JCGLCullingType g_c = g.culling(); final Optional<JCGLCullingStateType> cull_opt = r.cullingState(); if (cull_opt.isPresent()) { final JCGLCullingStateType cull_state = cull_opt.get(); g_c.cullingEnable( cull_state.faceSelection(), cull_state.faceWindingOrder()); } else { g_c.cullingDisable(); } }
g_cu.cullingEnable( JCGLFaceSelection.FACE_BACK, JCGLFaceWindingOrder.FRONT_FACE_COUNTER_CLOCKWISE);
@Test public final void testCulling() { final JCGLInterfaceGL33Type g = this.getGL33("main", 24, 8); final JCGLRenderStateMutable r = JCGLRenderStateMutable.create(); final JCGLCullingStateMutable cs = JCGLCullingStateMutable.create(); cs.setFaceSelection(JCGLFaceSelection.FACE_FRONT); cs.setFaceWindingOrder(JCGLFaceWindingOrder.FRONT_FACE_CLOCKWISE); r.setCullingState(Optional.of(cs)); JCGLRenderStates.activate(g, r); final JCGLCullingType g_c = g.getCulling(); Assert.assertTrue(g_c.cullingIsEnabled()); }
@Test public final void testCulling() { final JCGLInterfaceGL33Type g = this.getGL33("main", 24, 8); final JCGLRenderStateMutable r = JCGLRenderStateMutable.create(); final JCGLCullingStateMutable cs = JCGLCullingStateMutable.create(); cs.setFaceSelection(JCGLFaceSelection.FACE_FRONT); cs.setFaceWindingOrder(JCGLFaceWindingOrder.FRONT_FACE_CLOCKWISE); r.setCullingState(Optional.of(cs)); JCGLRenderStates.activate(g, r); final JCGLCullingType g_c = g.culling(); Assert.assertTrue(g_c.cullingIsEnabled()); }
@Test public final void testCullingIdentities() { final JCGLCullingType g_c = this.getCulling("main"); Assert.assertFalse(g_c.cullingIsEnabled()); for (final JCGLFaceSelection s : JCGLFaceSelection.values()) { for (final JCGLFaceWindingOrder w : JCGLFaceWindingOrder.values()) { g_c.cullingEnable(s, w); Assert.assertTrue(g_c.cullingIsEnabled()); g_c.cullingDisable(); Assert.assertFalse(g_c.cullingIsEnabled()); } } } }
@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()); }