aob.setIndexBuffer(ib); aob.setAttributeFloatingPoint( 0,
aob.setIndexBuffer(ib); aob.setAttributeFloatingPoint( 0,
aob.setIndexBuffer(this.index_buffer); aob.setAttributeFloatingPoint( 0,
aob.setIndexBuffer(this.index_buffer); aob.setAttributeFloatingPoint( 0,
aob.setIndexBuffer(this.index_buffer); aob.setAttributeFloatingPoint( 0,
aob.setIndexBuffer(i); aob.setAttributeFloatingPoint( R2AttributeConventions.POSITION_ATTRIBUTE_INDEX,
JCGLBufferUpdates.newUpdateReplacingAll(this.index_buffer); this.array_object_builder.setIndexBuffer(this.index_buffer); for (final Integer in_index : this.attributes_by_index.keySet()) { final Attribute attr = this.attributes_by_index.get(in_index);
@Test public final void testDrawElementsOK() { final Interfaces i = this.getInterfaces("main"); final JCGLArrayObjectsType go = i.getArrayObjects(); final JCGLIndexBuffersType gi = i.getIndexBuffers(); final JCGLDrawType gd = i.getDraw(); final JCGLIndexBufferType ib = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); gi.indexBufferUnbind(); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); b.setIndexBuffer(ib); final JCGLArrayObjectType ao = go.arrayObjectAllocate(b); gd.drawElements(JCGLPrimitives.PRIMITIVE_POINTS); }
@Test public final void testDrawElementsInstancedOK() { final Interfaces i = this.getInterfaces("main"); final JCGLArrayObjectsType go = i.getArrayObjects(); final JCGLIndexBuffersType gi = i.getIndexBuffers(); final JCGLDrawType gd = i.getDraw(); final JCGLIndexBufferType ib = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); gi.indexBufferUnbind(); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); b.setIndexBuffer(ib); final JCGLArrayObjectType ao = go.arrayObjectAllocate(b); gd.drawElementsInstanced(JCGLPrimitives.PRIMITIVE_POINTS, 1); }
@Test public final void testDrawElementsOK() { final Interfaces i = this.getInterfaces("main"); final JCGLArrayObjectsType go = i.getArrayObjects(); final JCGLIndexBuffersType gi = i.getIndexBuffers(); final JCGLDrawType gd = i.getDraw(); final JCGLIndexBufferType ib = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); gi.indexBufferUnbind(); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); b.setIndexBuffer(ib); final JCGLArrayObjectType ao = go.arrayObjectAllocate(b); gd.drawElements(JCGLPrimitives.PRIMITIVE_POINTS); }
@Test public final void testDrawElementsInstancedOK() { final Interfaces i = this.getInterfaces("main"); final JCGLArrayObjectsType go = i.getArrayObjects(); final JCGLIndexBuffersType gi = i.getIndexBuffers(); final JCGLDrawType gd = i.getDraw(); final JCGLIndexBufferType ib = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); gi.indexBufferUnbind(); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); b.setIndexBuffer(ib); final JCGLArrayObjectType ao = go.arrayObjectAllocate(b); gd.drawElementsInstanced(JCGLPrimitives.PRIMITIVE_POINTS, 1); }
b.setAttributeIntegral( 4, a, 2, JCGLScalarIntegralType.TYPE_INT, 24, 8L); b.setIndexBuffer(i);
b.setAttributeIntegral( 4, a, 2, JCGLScalarIntegralType.TYPE_INT, 24, 8L); b.setIndexBuffer(i);
@Test public final void testArrayAllocateIndexDeleted() { final Interfaces is = this.getInterfaces("main"); final JCGLArrayBuffersType ga = is.getArrayBuffers(); final JCGLIndexBuffersType gi = is.getIndexBuffers(); final JCGLArrayObjectsType go = is.getArrayObjects(); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLIndexBufferType i = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); b.setIndexBuffer(i); gi.indexBufferDelete(i); this.expected.expect(JCGLExceptionDeleted.class); go.arrayObjectAllocate(b); Assert.fail(); }
@Test public final void testArrayAllocateIndexDeleted() { final Interfaces is = this.getInterfaces("main"); final JCGLArrayBuffersType ga = is.getArrayBuffers(); final JCGLIndexBuffersType gi = is.getIndexBuffers(); final JCGLArrayObjectsType go = is.getArrayObjects(); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLIndexBufferType i = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); b.setIndexBuffer(i); gi.indexBufferDelete(i); this.expected.expect(JCGLExceptionDeleted.class); go.arrayObjectAllocate(b); Assert.fail(); }
static JCGLArrayObjectType getArrayObject( final JCGLInterfaceGL33Type g) { final JCGLArrayBuffersType g_ab = g.getArrayBuffers(); final JCGLIndexBuffersType g_ib = g.getIndexBuffers(); final JCGLArrayObjectsType g_ao = g.getArrayObjects(); final JCGLIndexBufferType ib = g_ib.indexBufferAllocate( 3L, JCGLUnsignedType.TYPE_UNSIGNED_INT, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayBufferUsableType a = g_ab.arrayBufferAllocate(3L * 4L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayObjectBuilderType aob = g_ao.arrayObjectNewBuilder(); aob.setAttributeFloatingPoint( 0, a, 3, JCGLScalarType.TYPE_FLOAT, 3 * 4, 0L, false); aob.setIndexBuffer(ib); final JCGLArrayObjectType ao = g_ao.arrayObjectAllocate(aob); g_ao.arrayObjectUnbind(); return ao; }
aob.setIndexBuffer(i); aob.setAttributeFloatingPoint( R2AttributeConventions.POSITION_ATTRIBUTE_INDEX,
@Test public final void testArrayBindIndexRebindDisallowed0() { final Interfaces i = this.getInterfaces("main"); final JCGLArrayBuffersType ga = i.getArrayBuffers(); final JCGLArrayObjectsType go = i.getArrayObjects(); final JCGLIndexBuffersType gi = i.getIndexBuffers(); final JCGLIndexBufferType ib0 = gi.indexBufferAllocate( 10L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLIndexBufferType ib1 = gi.indexBufferAllocate( 10L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); gi.indexBufferUnbind(); final JCGLArrayBufferType ab = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); Assert.assertTrue(b.getMaximumVertexAttributes() >= 16); b.setIndexBuffer(ib0); b.setAttributeFloatingPoint( 0, ab, 4, JCGLScalarType.TYPE_FLOAT, 16, 0L, false); final JCGLArrayObjectType ao0 = go.arrayObjectAllocate(b); Assert.assertEquals(ao0, go.arrayObjectGetCurrentlyBound()); this.expected.expect(JCGLExceptionIndexBufferAlreadyConfigured.class); gi.indexBufferBind(ib1); }