@Test public final void testArrayFromIdentities() { 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.setAttributeFloatingPointWithDivisor( 0, a, 4, JCGLScalarType.TYPE_FLOAT, 16, 0L, false, 23); b.setAttributeFloatingPoint( 1, a, 3, JCGLScalarType.TYPE_INT, 20, 4L, true); b.setAttributeIntegral( 2, a, 2, JCGLScalarIntegralType.TYPE_INT, 24, 8L); final JCGLArrayObjectType o = go.arrayObjectAllocate(b); final JCGLArrayObjectBuilderType c = go.arrayObjectNewBuilderFromObject(o); for (int index = 0; index < b.getMaximumVertexAttributes(); ++index) { Assert.assertEquals(b.getAttributeAt(index), c.getAttributeAt(index)); } }
@Test public final void testArrayFromIdentities() { 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.setAttributeFloatingPointWithDivisor( 0, a, 4, JCGLScalarType.TYPE_FLOAT, 16, 0L, false, 23); b.setAttributeFloatingPoint( 1, a, 3, JCGLScalarType.TYPE_INT, 20, 4L, true); b.setAttributeIntegral( 2, a, 2, JCGLScalarIntegralType.TYPE_INT, 24, 8L); final JCGLArrayObjectType o = go.arrayObjectAllocate(b); final JCGLArrayObjectBuilderType c = go.arrayObjectNewBuilderFromObject(o); for (int index = 0; index < b.getMaximumVertexAttributes(); ++index) { Assert.assertEquals(b.getAttributeAt(index), c.getAttributeAt(index)); } }