@Test public final void testFramebufferBlitSameFramebufferDefault() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final AreaL area = AreasL.create(0L, 0L, 640L, 480L); g_fb.framebufferDrawUnbind(); g_fb.framebufferReadUnbind(); this.expected.expect(JCGLExceptionFramebufferReadDrawSame.class); g_fb.framebufferBlit( area, area, EnumSet.of(JCGLFramebufferBlitBuffer.FRAMEBUFFER_BLIT_BUFFER_DEPTH), JCGLFramebufferBlitFilter.FRAMEBUFFER_BLIT_FILTER_LINEAR); }
@Test public final void testFramebufferBlitSameFramebufferDefault() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final AreaInclusiveUnsignedLType area = AreaInclusiveUnsignedL.of( new UnsignedRangeInclusiveL(0L, 639L), new UnsignedRangeInclusiveL(0L, 479L)); g_fb.framebufferDrawUnbind(); g_fb.framebufferReadUnbind(); this.expected.expect(JCGLExceptionFramebufferReadDrawSame.class); g_fb.framebufferBlit( area, area, EnumSet.of(JCGLFramebufferBlitBuffer.FRAMEBUFFER_BLIT_BUFFER_DEPTH), JCGLFramebufferBlitFilter.FRAMEBUFFER_BLIT_FILTER_LINEAR); }
g_fb.framebufferDrawUnbind(); g_fb.framebufferReadUnbind(); g_fb.framebufferReadBind(fb_read);
g_fb.framebufferDrawUnbind(); g_fb.framebufferReadUnbind(); g_fb.framebufferReadBind(fb_read);
g_fb.framebufferDrawUnbind(); g_fb.framebufferReadUnbind(); g_fb.framebufferDrawBind(fb_draw);
@Test public final void testFramebufferBindFeedback() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDrawUnbind(); g_tx.texture2DBind(u0, t); this.expected.expect(JCGLExceptionFeedback.class); g_fb.framebufferDrawBind(fb); }
@Test public final void testFramebufferBindFeedbackTexture() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDrawUnbind(); g_fb.framebufferDrawBind(fb); this.expected.expect(JCGLExceptionFeedback.class); g_tx.texture2DBind(u0, t); }
@Test public final void testFramebufferBindFeedback() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDrawUnbind(); g_tx.texture2DBind(u0, t); this.expected.expect(JCGLExceptionFeedback.class); g_fb.framebufferDrawBind(fb); }
@Test public final void testFramebufferBindFeedbackTexture() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDrawUnbind(); g_fb.framebufferDrawBind(fb); this.expected.expect(JCGLExceptionFeedback.class); g_tx.texture2DBind(u0, t); }
@Override public void renderDepthVariance( final R2DepthVarianceBufferUsableType dbuffer, final JCGLTextureUnitContextParentType uc, final R2MatricesObserverType m, final R2DepthInstancesType s) { NullCheck.notNull(dbuffer); NullCheck.notNull(uc); NullCheck.notNull(m); NullCheck.notNull(s); Preconditions.checkPrecondition( !this.isDeleted(), "Renderer must not be deleted"); final JCGLFramebufferUsableType gb_fb = dbuffer.primaryFramebuffer(); final JCGLFramebuffersType g_fb = this.g.getFramebuffers(); try { g_fb.framebufferDrawBind(gb_fb); this.renderDepthVarianceWithBoundBuffer(dbuffer.area(), uc, m, s); } finally { g_fb.framebufferDrawUnbind(); } }
@Override public void renderDepth( final R2DepthOnlyBufferUsableType dbuffer, final JCGLTextureUnitContextParentType uc, final R2MatricesObserverType m, final R2DepthInstancesType s) { NullCheck.notNull(dbuffer); NullCheck.notNull(uc); NullCheck.notNull(m); NullCheck.notNull(s); Preconditions.checkPrecondition( !this.isDeleted(), "Renderer must not be deleted"); final JCGLFramebufferUsableType gb_fb = dbuffer.primaryFramebuffer(); final JCGLFramebuffersType g_fb = this.g.getFramebuffers(); try { g_fb.framebufferDrawBind(gb_fb); this.renderDepthWithBoundBuffer(dbuffer.area(), uc, m, s); } finally { g_fb.framebufferDrawUnbind(); } }
Assert.assertTrue(g_fb.framebufferDrawIsBound(fb)); g_fb.framebufferDrawUnbind(); Assert.assertEquals(Optional.empty(), g_fb.framebufferDrawGetBound()); Assert.assertFalse(g_fb.framebufferDrawAnyIsBound());
ga.arrayObjectUnbind(); gs.shaderDeactivateProgram(); gf.framebufferDrawUnbind();
Assert.assertTrue(g_fb.framebufferDrawIsBound(fb)); g_fb.framebufferDrawUnbind(); Assert.assertEquals(Optional.empty(), g_fb.framebufferDrawGetBound()); Assert.assertFalse(g_fb.framebufferDrawAnyIsBound());
@Test public final void testFramebufferDeleteIdentitiesRead() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDrawUnbind(); g_fb.framebufferReadBind(fb); Assert.assertEquals(Optional.of(fb), g_fb.framebufferReadGetBound()); Assert.assertTrue(g_fb.framebufferReadAnyIsBound()); Assert.assertTrue(g_fb.framebufferReadIsBound(fb)); g_fb.framebufferDelete(fb); Assert.assertTrue(fb.isDeleted()); Assert.assertFalse(g_fb.framebufferReadAnyIsBound()); }
@Test public final void testFramebufferDeleteIdentitiesRead() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final JCGLTexturesType g_tx = i.getTextures(); final JCGLFramebufferBuilderType fbb = g_fb.framebufferNewBuilder(); final List<JCGLTextureUnitType> us = g_tx.textureGetUnits(); final JCGLTextureUnitType u0 = us.get(0); final JCGLTexture2DType t = g_tx.texture2DAllocate( u0, 64L, 64L, JCGLTextureFormat.TEXTURE_FORMAT_DEPTH_16_2BPP, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); g_tx.textureUnitUnbind(u0); fbb.attachDepthTexture2D(t); final JCGLFramebufferType fb = g_fb.framebufferAllocate(fbb); g_fb.framebufferDrawUnbind(); g_fb.framebufferReadBind(fb); Assert.assertEquals(Optional.of(fb), g_fb.framebufferReadGetBound()); Assert.assertTrue(g_fb.framebufferReadAnyIsBound()); Assert.assertTrue(g_fb.framebufferReadIsBound(fb)); g_fb.framebufferDelete(fb); Assert.assertTrue(fb.isDeleted()); Assert.assertFalse(g_fb.framebufferReadAnyIsBound()); }
private static R2GeometryBufferType newGeometryBuffer( final JCGLFramebuffersType g_fb, final JCGLTexturesType g_tex, final JCGLTextureUnitContextParentType tr) { final JCGLTextureUnitContextType tc = tr.unitContextNew(); try { final R2GeometryBufferDescription gbuffer_desc = R2GeometryBufferDescription.of( AreaInclusiveUnsignedL.of( new UnsignedRangeInclusiveL(0L, 4L), new UnsignedRangeInclusiveL(0L, 4L)), R2GeometryBufferComponents.R2_GEOMETRY_BUFFER_FULL); final R2GeometryBufferType gb = R2GeometryBuffer.newGeometryBuffer( g_fb, g_tex, tc, gbuffer_desc); g_fb.framebufferDrawUnbind(); return gb; } finally { tc.unitContextFinish(g_tex); } }
private static R2GeometryBufferType newGeometryBuffer( final JCGLFramebuffersType g_fb, final JCGLTexturesType g_tex, final JCGLTextureUnitContextParentType tr) { final JCGLTextureUnitContextType tc = tr.unitContextNew(); try { final R2GeometryBufferDescription gbuffer_desc = R2GeometryBufferDescription.of( AreaInclusiveUnsignedL.of( new UnsignedRangeInclusiveL(0L, 4L), new UnsignedRangeInclusiveL(0L, 4L)), R2GeometryBufferComponents.R2_GEOMETRY_BUFFER_FULL); final R2GeometryBufferType gb = R2GeometryBuffer.newGeometryBuffer( g_fb, g_tex, tc, gbuffer_desc); g_fb.framebufferDrawUnbind(); return gb; } finally { tc.unitContextFinish(g_tex); } }
private static R2GeometryBufferType newGeometryBuffer( final JCGLFramebuffersType g_fb, final JCGLTexturesType g_tex, final JCGLTextureUnitContextParentType tr) { final JCGLTextureUnitContextType tc = tr.unitContextNew(); try { final R2GeometryBufferDescription gbuffer_desc = R2GeometryBufferDescription.of( AreaInclusiveUnsignedL.of( new UnsignedRangeInclusiveL(0L, 4L), new UnsignedRangeInclusiveL(0L, 4L)), R2GeometryBufferComponents.R2_GEOMETRY_BUFFER_FULL); final R2GeometryBufferType gb = R2GeometryBuffer.newGeometryBuffer( g_fb, g_tex, tc, gbuffer_desc); g_fb.framebufferDrawUnbind(); return gb; } finally { tc.unitContextFinish(g_tex); } }
mo, t.depth_instances); g_fb.framebufferDrawUnbind(); return Unit.unit(); });