up -> this.g.evaluate((g33, unused) -> { final JCGLIndexBuffersType gi = g33.getIndexBuffers(); gi.indexBufferBind(up.getBuffer()); gi.indexBufferUpdate(up); gi.indexBufferUnbind();
up -> this.g.evaluate((g33, unused) -> { final JCGLIndexBuffersType gi = g33.indexBuffers(); gi.indexBufferBind(up.buffer()); gi.indexBufferUpdate(up); gi.indexBufferUnbind();
@Test public final void testIndexUpdateShared() { final JCGLSharedContextPair<JCGLIndexBuffersType> p = this.getIndexBuffersSharedWith("main", "alt"); final JCGLContextType ca = p.getMasterContext(); final JCGLContextType cb = p.getSlaveContext(); final JCGLIndexBuffersType gi = p.getMasterValue(); final JCGLIndexBuffersType gb = p.getSlaveValue(); Assert.assertTrue(ca.contextIsCurrent()); Assert.assertFalse(cb.contextIsCurrent()); final JCGLIndexBufferType i = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLIndexBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(i); ca.contextReleaseCurrent(); cb.contextMakeCurrent(); gb.indexBufferBind(i); gb.indexBufferUpdate(u); }
@Test public final void testIndexUpdateShared() { final JCGLSharedContextPair<JCGLIndexBuffersType> p = this.getIndexBuffersSharedWith("main", "alt"); final JCGLContextType ca = p.getMasterContext(); final JCGLContextType cb = p.getSlaveContext(); final JCGLIndexBuffersType gi = p.getMasterValue(); final JCGLIndexBuffersType gb = p.getSlaveValue(); Assert.assertTrue(ca.contextIsCurrent()); Assert.assertFalse(cb.contextIsCurrent()); final JCGLIndexBufferType i = gi.indexBufferAllocate( 100L, JCGLUnsignedType.TYPE_UNSIGNED_BYTE, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLIndexBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(i); ca.contextReleaseCurrent(); cb.contextMakeCurrent(); gb.indexBufferBind(i); gb.indexBufferUpdate(u); }
@Test public final void testArrayBindIndexRebindDisallowed1() { 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); gi.indexBufferUnbind(); final JCGLArrayBufferType ab = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLArrayObjectBuilderType b = go.arrayObjectNewBuilder(); Assert.assertTrue(b.getMaximumVertexAttributes() >= 16); 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(ib0); }
@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); }