@Override public boolean isDeleted() { return this.data_vao.isDeleted(); }
@Override public String toString() { return String.format( "[instance %d [array %d]]", Long.valueOf(id), Integer.valueOf(ao.getGLName())); }
Assert.assertFalse(ai.isDeleted()); Assert.assertEquals( (long) b.getMaximumVertexAttributes(), (long) ai.getMaximumVertexAttributes()); for (int index = 0; index < ai.getMaximumVertexAttributes(); ++index) { Assert.assertEquals(b.getAttributeAt(index), ai.getAttributeAt(index)); Assert.assertEquals(Optional.of(i), ai.getIndexBufferBound()); final Set<JCGLReferableType> ai_refs = ai.getReferences(); Assert.assertEquals(2L, (long) ai_refs.size()); Assert.assertTrue(ai_refs.contains(a));
Assert.assertFalse(ai.isDeleted()); Assert.assertEquals( (long) b.getMaximumVertexAttributes(), (long) ai.attributeMaximumSupported()); for (int index = 0; index < ai.attributeMaximumSupported(); ++index) { Assert.assertEquals(b.getAttributeAt(index), ai.attributeAt(index)); Assert.assertEquals(Optional.of(i), ai.indexBufferBound()); final Set<JCGLReferableType> ai_refs = ai.references(); Assert.assertEquals(2L, (long) ai_refs.size()); Assert.assertTrue(ai_refs.contains(a));
Assert.assertEquals(ao.getIndexBufferBound().get(), ib); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.POSITION_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.NORMAL_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.TANGENT4_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.UV_ATTRIBUTE_INDEX).isPresent());
@Test public final void testArrayDeleteIdentity() { final Interfaces i = this.getInterfaces("main"); final JCGLArrayBuffersType ga = i.getArrayBuffers(); final JCGLArrayObjectsType go = i.getArrayObjects(); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); Assert.assertTrue(b.getMaximumVertexAttributes() >= 16); b.setAttributeFloatingPoint( 0, a, 4, JCGLScalarType.TYPE_FLOAT, 16, 0L, false); final JCGLArrayObjectType ai = go.arrayObjectAllocate(b); go.arrayObjectDelete(ai); Assert.assertTrue(ai.isDeleted()); final Set<JCGLReferableType> ai_refs = ai.getReferences(); Assert.assertEquals(0L, (long) ai_refs.size()); final Set<JCGLReferenceContainerType> a_refs = a.getReferringContainers(); Assert.assertEquals(0L, (long) a_refs.size()); }
@Test public final void testArrayDeleteIdentity() { final Interfaces i = this.getInterfaces("main"); final JCGLArrayBuffersType ga = i.getArrayBuffers(); final JCGLArrayObjectsType go = i.getArrayObjects(); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); Assert.assertTrue(b.getMaximumVertexAttributes() >= 16); b.setAttributeFloatingPoint( 0, a, 4, JCGLScalarType.TYPE_FLOAT, 16, 0L, false); final JCGLArrayObjectType ai = go.arrayObjectAllocate(b); go.arrayObjectDelete(ai); Assert.assertTrue(ai.isDeleted()); final Set<JCGLReferableType> ai_refs = ai.references(); Assert.assertEquals(0L, (long) ai_refs.size()); final Set<JCGLReferenceContainerType> a_refs = a.referringContainers(); Assert.assertEquals(0L, (long) a_refs.size()); }
Assert.assertEquals(Optional.of(ib), ai_0.getIndexBufferBound()); Assert.assertEquals(Optional.of(ib), ai_1.getIndexBufferBound()); Assert.assertEquals(Optional.of(ib), ai_2.getIndexBufferBound()); Assert.assertEquals(Optional.of(ib), gi.indexBufferGetCurrentlyBound()); final Set<JCGLReferableType> ai0_refs = ai_0.getReferences(); final Set<JCGLReferableType> ai1_refs = ai_1.getReferences(); final Set<JCGLReferableType> ai2_refs = ai_2.getReferences();
3L, index_buffer.getRange().getInterval()); Assert.assertEquals( array_buffer, array_object.getAttributeAt(0).get().getArrayBuffer());
Assert.assertEquals(Optional.of(ib), ai_0.indexBufferBound()); Assert.assertEquals(Optional.of(ib), ai_1.indexBufferBound()); Assert.assertEquals(Optional.of(ib), ai_2.indexBufferBound()); Assert.assertEquals(Optional.of(ib), gi.indexBufferGetCurrentlyBound()); final Set<JCGLReferableType> ai0_refs = ai_0.references(); final Set<JCGLReferableType> ai1_refs = ai_1.references(); final Set<JCGLReferableType> ai2_refs = ai_2.references();
@Test public final void testArrayBufferDeletion() { final Interfaces i = this.getInterfaces("main"); final JCGLArrayBuffersType ga = i.getArrayBuffers(); final JCGLArrayObjectsType go = i.getArrayObjects(); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferUnbind(); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); b.setAttributeIntegral( 0, a, 1, JCGLScalarIntegralType.TYPE_UNSIGNED_BYTE, 0, 0L); final JCGLArrayObjectType ao = go.arrayObjectAllocate(b); Assert.assertEquals(ao, go.arrayObjectGetCurrentlyBound()); ga.arrayBufferDelete(a); go.arrayObjectBind(ao); final Set<JCGLReferableType> refs = ao.getReferences(); Assert.assertEquals(1L, (long) refs.size()); Assert.assertTrue(refs.contains(a)); }
Assert.assertEquals(ao.getIndexBufferBound().get(), ib); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.POSITION_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.NORMAL_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.TANGENT4_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.UV_ATTRIBUTE_INDEX).isPresent());
final Set<JCGLReferableType> a0_refs = a0.getReferences(); final Set<JCGLReferableType> a1_refs = a1.getReferences(); Assert.assertEquals(Optional.of(i0), a1.getIndexBufferBound()); Assert.assertEquals(0L, (long) a0_refs.size()); Assert.assertEquals(1L, (long) a1_refs.size()); Assert.assertEquals(Optional.empty(), a1.getIndexBufferBound()); Assert.assertEquals(0L, (long) a0_refs.size()); Assert.assertEquals(0L, (long) a1_refs.size());
Assert.assertEquals(ao.getIndexBufferBound().get(), ib); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.POSITION_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.NORMAL_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.TANGENT4_ATTRIBUTE_INDEX).isPresent()); Assert.assertTrue(ao.getAttributeAt( R2AttributeConventions.UV_ATTRIBUTE_INDEX).isPresent());
@Override public boolean isDeleted() { return this.matrix_vao.isDeleted(); } }