private void deleteActual() { if (this.array != null) { this.g33_array_buffers.arrayBufferDelete(this.array); this.array = null; } if (this.array_object != null) { this.g33_array_objects.arrayObjectDelete(this.array_object); this.array_object = null; } }
@Test public final void testArrayDeleteDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferDelete(a); Assert.fail(); }
@Test public final void testArrayDeleteDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferDelete(a); Assert.fail(); }
@Test public final void testArrayReadDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferRead(a, size -> ByteBuffer.allocateDirect((int) size)); Assert.fail(); }
@Test public final void testArrayReadDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferRead(a, size -> ByteBuffer.allocateDirect((int) size)); Assert.fail(); }
@Test public final void testArrayDeleteUnbinds() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferBind(a); Assert.assertEquals(Optional.of(a), ga.arrayBufferGetCurrentlyBound()); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); Assert.assertFalse(ga.arrayBufferGetCurrentlyBound().isPresent()); }
@Override public void delete( final JCGLInterfaceGL33Type g) throws R2Exception { NullCheck.notNull(g); if (!this.isDeleted()) { final JCGLArrayObjectsType g_ao = g.getArrayObjects(); final JCGLArrayBuffersType g_ab = g.getArrayBuffers(); g_ab.arrayBufferDelete(this.data_vbo); g_ao.arrayObjectDelete(this.data_vao); } }
@Test public final void testArrayDeleteUnbinds() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferBind(a); Assert.assertEquals(Optional.of(a), ga.arrayBufferGetCurrentlyBound()); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); Assert.assertFalse(ga.arrayBufferGetCurrentlyBound().isPresent()); }
@Override public void delete(final JCGLInterfaceGL33Type g) throws R2Exception { if (!this.isDeleted()) { g.getArrayBuffers().arrayBufferDelete(this.array_buffer); g.getArrayObjects().arrayObjectDelete(this.array_object); g.getIndexBuffers().indexBufferDelete(this.index_buffer); } }
@Override public void delete(final JCGLInterfaceGL33Type g) throws R2Exception { if (!this.isDeleted()) { g.getArrayBuffers().arrayBufferDelete(this.array_buffer); g.getArrayObjects().arrayObjectDelete(this.array_object); g.getIndexBuffers().indexBufferDelete(this.index_buffer); } }
@Override public void delete(final JCGLInterfaceGL33Type g) throws R2Exception { NullCheck.notNull(g); if (!this.isDeleted()) { final JCGLArrayObjectsType g_ao = g.getArrayObjects(); final JCGLArrayBuffersType g_ab = g.getArrayBuffers(); g_ab.arrayBufferDelete(this.matrix_vbo); g_ao.arrayObjectDelete(this.matrix_vao); this.disableAll(); } }
@Test public final void testArrayUpdateDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLArrayBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(a); ga.arrayBufferDelete(a); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferUpdate(u); Assert.fail(); }
@Test public final void testArrayUpdateDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLArrayBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(a); ga.arrayBufferDelete(a); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferUpdate(u); Assert.fail(); }
@Test public final void testArrayDeleteNoUnbindOther() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayBufferType b = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferBind(a); Assert.assertEquals(Optional.of(a), ga.arrayBufferGetCurrentlyBound()); ga.arrayBufferDelete(b); Assert.assertTrue(b.isDeleted()); Assert.assertFalse(a.isDeleted()); Assert.assertEquals(Optional.of(a), ga.arrayBufferGetCurrentlyBound()); }
@Override public void onFinish(final JCGLInterfaceGL33Type g) { final JCGLArrayBuffersType g_ab = g.getArrayBuffers(); final JCGLArrayObjectsType g_ao = g.getArrayObjects(); final JCGLIndexBuffersType g_ib = g.getIndexBuffers(); final JCGLShadersType g_sh = g.getShaders(); /** * Delete everything. */ g_ib.indexBufferDelete(this.index_buffer); g_ab.arrayBufferDelete(this.array_buffer); g_ao.arrayObjectDelete(this.array_object); g_sh.shaderDeleteProgram(this.program); } }
@Test public final void testArrayIsBoundDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferIsBound(a); Assert.fail(); }
@Test public final void testArrayBindDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferBind(a); Assert.fail(); }
@Override public void onFinish(final JCGLInterfaceGL33Type g) { final JCGLArrayBuffersType g_ab = g.getArrayBuffers(); final JCGLArrayObjectsType g_ao = g.getArrayObjects(); final JCGLIndexBuffersType g_ib = g.getIndexBuffers(); final JCGLShadersType g_sh = g.getShaders(); /** * Delete everything. */ g_ib.indexBufferDelete(this.index_buffer); g_ab.arrayBufferDelete(this.array_buffer); g_ao.arrayObjectDelete(this.array_object); g_sh.shaderDeleteProgram(this.program); } }
@Test public final void testArrayBindDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferBind(a); Assert.fail(); }
@Test public final void testArrayIsBoundDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferIsBound(a); Assert.fail(); }