final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 2L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 4L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 4L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 3L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 2L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 3L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 3L, (long) data.capacity()); final int row_bytes = 512 * 3;
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 4L, (long) data.capacity()); final int row_bytes = 512 * 4;
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 2L, (long) data.capacity()); final int row_bytes = 512 * 2;
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L, (long) data.capacity());
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L * 2L, (long) data.capacity()); final int row_bytes = 512 * 2;
final ByteBuffer data = t.texture2DGetImage(u, ta); Assert.assertEquals(512L * 512L, (long) data.capacity());
@Test public final void testTexture2DGetImageIdentities() { final JCGLTexturesType t = this.getTextures("main"); final List<JCGLTextureUnitType> us = t.textureGetUnits(); final JCGLTextureUnitType u = us.get(0); for (final JCGLTextureFormat v : JCGLTextureFormat.values()) { final JCGLTexture2DType ta = t.texture2DAllocate( u, 128L, 256L, v, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_LINEAR, JCGLTextureFilterMagnification.TEXTURE_FILTER_LINEAR); Assert.assertTrue(t.textureUnitIsBound(u)); Assert.assertTrue(t.texture2DIsBound(u, ta)); final ByteBuffer i = t.texture2DGetImage(u, ta); Assert.assertEquals(ByteOrder.nativeOrder(), i.order()); Assert.assertEquals( 128L * 256L * (long) v.getBytesPerPixel(), (long) i.capacity()); Assert.assertFalse(ta.isDeleted()); t.texture2DDelete(ta); Assert.assertTrue(ta.isDeleted()); } }
@Test public final void testTexture2DGetImageIdentities() { final JCGLTexturesType t = this.getTextures("main"); final List<JCGLTextureUnitType> us = t.textureGetUnits(); final JCGLTextureUnitType u = us.get(0); for (final JCGLTextureFormat v : JCGLTextureFormat.values()) { final JCGLTexture2DType ta = t.texture2DAllocate( u, 128L, 256L, v, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_LINEAR, JCGLTextureFilterMagnification.TEXTURE_FILTER_LINEAR); Assert.assertTrue(t.textureUnitIsBound(u)); Assert.assertTrue(t.texture2DIsBound(u, ta)); final ByteBuffer i = t.texture2DGetImage(u, ta); Assert.assertEquals(ByteOrder.nativeOrder(), i.order()); Assert.assertEquals( 128L * 256L * (long) v.getBytesPerPixel(), (long) i.capacity()); Assert.assertFalse(ta.isDeleted()); t.texture2DDelete(ta); Assert.assertTrue(ta.isDeleted()); } }
final ByteBuffer i = gt.texture2DGetImage(unit_0, at); gt.textureUnitUnbind(unit_0);
final ByteBuffer i = gt.texture2DGetImage(unit_0, at); gt.textureUnitUnbind(unit_0);
final ByteBuffer i = gt.texture2DGetImage(unit_0, at); gt.textureUnitUnbind(unit_0);
final ByteBuffer i = gt.texture2DGetImage(unit_0, at); gt.textureUnitUnbind(unit_0);