private static void configureScissor( final JCGLInterfaceGL33Type g, final JCGLRenderStateType r) { final JCGLScissorType g_s = g.scissor(); final Optional<AreaL> scissor_opt = r.scissor(); if (scissor_opt.isPresent()) { final AreaL area = scissor_opt.get(); g_s.scissorEnable(area); } else { g_s.scissorDisable(); } }
@Test public final void testIdentities() { final JCGLScissorType s = this.getScissor("main"); Assert.assertFalse(s.scissorIsEnabled()); s.scissorEnable(AreasL.create(0L, 0L, 64L, 64L)); Assert.assertTrue(s.scissorIsEnabled()); s.scissorEnable(AreasL.create(0L, 0L, 64L, 64L)); Assert.assertTrue(s.scissorIsEnabled()); s.scissorDisable(); Assert.assertFalse(s.scissorIsEnabled()); s.scissorDisable(); Assert.assertFalse(s.scissorIsEnabled()); } }
@Test public final void testIdentities() { final JCGLScissorType s = this.getScissor("main"); Assert.assertFalse(s.scissorIsEnabled()); s.scissorEnable(AreaInclusiveUnsignedL.of( new UnsignedRangeInclusiveL(0L, 63L), new UnsignedRangeInclusiveL(0L, 63L))); Assert.assertTrue(s.scissorIsEnabled()); s.scissorEnable(AreaInclusiveUnsignedL.of( new UnsignedRangeInclusiveL(0L, 63L), new UnsignedRangeInclusiveL(0L, 63L))); Assert.assertTrue(s.scissorIsEnabled()); s.scissorDisable(); Assert.assertFalse(s.scissorIsEnabled()); s.scissorDisable(); Assert.assertFalse(s.scissorIsEnabled()); } }