final ByteBuffer data = up.data(); Assert.assertEquals(512L * 512L * 2L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
@Test public final void testTextureCubeUpdateAreaIdentities() { final JCGLTexturesType t = this.getTextures("main"); final List<JCGLTextureUnitType> us = t.textureGetUnits(); final JCGLTextureUnitType u = us.get(0); final JCGLTextureCubeType ta = t.textureCubeAllocate( u, 512L, JCGLTextureFormat.TEXTURE_FORMAT_R_8_1BPP, JCGLTextureWrapR.TEXTURE_WRAP_REPEAT, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_LINEAR, JCGLTextureFilterMagnification.TEXTURE_FILTER_LINEAR); final AreaL expected_area = AreasL.create(128L, 128L, 128L, 128L); final JCGLTextureCubeUpdateType up = JCGLTextureUpdates.newUpdateReplacingAreaCube(ta, expected_area); Assert.assertEquals(ta, up.texture()); Assert.assertEquals(expected_area, up.area()); final ByteBuffer data = up.data(); final long expected_size = 128L * 128L; Assert.assertEquals(expected_size, (long) data.capacity()); final UnsignedRangeInclusiveL expected_range = new UnsignedRangeInclusiveL(0L, expected_size - 1L); Assert.assertEquals(expected_range, up.dataUpdateRange()); }
final ByteBuffer data = up.data(); Assert.assertEquals(512L * 512L * 4L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
@Test public final void testTextureCubeUpdateAllIdentities() { final JCGLTexturesType t = this.getTextures("main"); final List<JCGLTextureUnitType> us = t.textureGetUnits(); final JCGLTextureUnitType u = us.get(0); final JCGLTextureCubeType ta = t.textureCubeAllocate( u, 128L, JCGLTextureFormat.TEXTURE_FORMAT_RGBA_8_4BPP, JCGLTextureWrapR.TEXTURE_WRAP_REPEAT, JCGLTextureWrapS.TEXTURE_WRAP_REPEAT, JCGLTextureWrapT.TEXTURE_WRAP_REPEAT, JCGLTextureFilterMinification.TEXTURE_FILTER_LINEAR, JCGLTextureFilterMagnification.TEXTURE_FILTER_LINEAR); final JCGLTextureCubeUpdateType up = JCGLTextureUpdates.newUpdateReplacingAllCube(ta); Assert.assertEquals(ta, up.texture()); final AreaL expected_area = AreasL.create(0L, 0L, 128L, 128L); Assert.assertEquals(expected_area, up.area()); final ByteBuffer data = up.data(); final long expected_size = 128L * 128L * 4L; Assert.assertEquals(expected_size, (long) data.capacity()); final UnsignedRangeInclusiveL expected_range = new UnsignedRangeInclusiveL(0L, expected_size - 1L); Assert.assertEquals(expected_range, up.dataUpdateRange()); }
final ByteBuffer data = up.data(); Assert.assertEquals(512L * 512L * 3L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = up.data(); for (int index = 0; index < data.capacity(); ++index) { data.put(index, (byte) 0xff);
@Override public JCGLTextureCubeUpdateType createTextureUpdateCube( final JCGLTextureCubeUsableType t, final JCGLTLTextureDataType data) { final JCGLTextureCubeUpdateType u = JCGLTextureUpdates.newUpdateReplacingAllCube(t); final int tw = (int) t.width(); final long dw = data.width(); RangeCheck.checkGreaterEqualLong( (long) tw, "Texture size", dw, "Data size"); populate( t.format(), data, u.data(), tw, tw); return u; }
final ByteBuffer data = up.data(); Assert.assertEquals(512L * 512L * 2L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) { final ByteBuffer data = up.data(); Assert.assertEquals(128L * 128L * 2L, (long) data.capacity()); for (int index = 0; index < data.capacity(); index += 2) {
final ByteBuffer data = up.data(); Assert.assertEquals(512L * 512L * 3L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) { final ByteBuffer data = up.data(); Assert.assertEquals(128L * 128L * 3L, (long) data.capacity()); for (int index = 0; index < data.capacity(); index += 3) {
final ByteBuffer data = up.data(); Assert.assertEquals(512L * 512L * 4L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) { final ByteBuffer data = up.data(); Assert.assertEquals(128L * 128L * 4L, (long) data.capacity()); for (int index = 0; index < data.capacity(); index += 4) {
final ByteBuffer buffer = data.data(); final int gface = LWJGL3TypeConversions.cubeFaceToGL(face);
final long source_min_y = update_area.minimumY(); final long source_height = update_area.height(); final ByteBuffer source_data = data.data();