@Test public final void testIndexReallocateNotBound() { final Interfaces ii = this.getIndexBuffers("main"); final JCGLIndexBuffersType gi = ii.getIndexBuffers(); final JCGLIndexBufferType i = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); gi.indexBufferUnbind(); this.expected.expect(JCGLExceptionBufferNotBound.class); gi.indexBufferReallocate(i); }
@Test public final void testIndexReallocateNotBound() { final Interfaces ii = this.getIndexBuffers("main"); final JCGLIndexBuffersType gi = ii.getIndexBuffers(); final JCGLIndexBufferType i = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); gi.indexBufferUnbind(); this.expected.expect(JCGLExceptionBufferNotBound.class); gi.indexBufferReallocate(i); }
@Test public final void testIndexBufferReallocateIdentity() { final Interfaces i = this.getIndexBuffers("name"); final JCGLIndexBuffersType gi = i.getIndexBuffers(); final JCGLIndexBufferType i0 = gi.indexBufferAllocate( 1000L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); Assert.assertEquals(1000L, i0.getIndices()); Assert.assertEquals(JCGLUnsignedType.TYPE_UNSIGNED_BYTE, i0.getType()); Assert.assertEquals(JCGLUsageHint.USAGE_STATIC_DRAW, i0.getUsageHint()); Assert.assertFalse(i0.isDeleted()); gi.indexBufferReallocate(i0); Assert.assertEquals(1000L, i0.getIndices()); Assert.assertEquals(JCGLUnsignedType.TYPE_UNSIGNED_BYTE, i0.getType()); Assert.assertEquals(JCGLUsageHint.USAGE_STATIC_DRAW, i0.getUsageHint()); Assert.assertFalse(i0.isDeleted()); }
@Test public final void testIndexBufferReallocateIdentity() { final Interfaces i = this.getIndexBuffers("name"); final JCGLIndexBuffersType gi = i.getIndexBuffers(); final JCGLIndexBufferType i0 = gi.indexBufferAllocate( 1000L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); Assert.assertEquals(1000L, i0.indices()); Assert.assertEquals(JCGLUnsignedType.TYPE_UNSIGNED_BYTE, i0.type()); Assert.assertEquals(JCGLUsageHint.USAGE_STATIC_DRAW, i0.usageHint()); Assert.assertFalse(i0.isDeleted()); gi.indexBufferReallocate(i0); Assert.assertEquals(1000L, i0.indices()); Assert.assertEquals(JCGLUnsignedType.TYPE_UNSIGNED_BYTE, i0.type()); Assert.assertEquals(JCGLUsageHint.USAGE_STATIC_DRAW, i0.usageHint()); Assert.assertFalse(i0.isDeleted()); }