public static JCGLTextureCubeUpdateType newUpdateReplacingAreaCube(
    final JCGLTextureCubeUsableType t,
    final AreaL update_area)
  {
    NullCheck.notNull(t, "Texture");
    NullCheck.notNull(update_area, "Area");

    final AreaL texture_area = AreaSizesL.area(t.size());
    if (!AreasL.contains(texture_area, update_area)) {
      final StringBuilder sb = new StringBuilder(128);
      sb.append("Target area is not contained within the texture's area.");
      sb.append(System.lineSeparator());
      sb.append("  Texture area: ");
      sb.append(t.size());
      sb.append(System.lineSeparator());
      sb.append("  Target area:  ");
      sb.append(update_area);
      sb.append(System.lineSeparator());
      throw new RangeCheckException(sb.toString());
    }

    final long width = update_area.width();
    final long height = update_area.height();
    final int bpp = t.format().getBytesPerPixel();
    final long size = width * height * (long) bpp;

    final ByteBuffer data = ByteBuffer.allocateDirect(Math.toIntExact(size));
    data.order(ByteOrder.nativeOrder());
    return new UpdateCube(t, update_area, data);
  }
public static JCGLTextureCubeUpdateType newUpdateReplacingAreaCube ( final JCGLTextureCubeUsableType t , final AreaL update_area ) { NullCheck . notNull ( t , "Texture" ) ; NullCheck . notNull ( update_area , "Area" ) ; final AreaL texture_area = AreaSizesL . area ( t . size ( ) ) ; if ( ! AreasL . contains ( texture_area , update_area ) ) { final StringBuilder sb = new StringBuilder ( 128 ) ; sb . append ( "Target area is not contained within the texture's area." ) ; sb . append ( System . lineSeparator ( ) ) ; sb . append ( "  Texture area: " ) ; sb . append ( t . size ( ) ) ; sb . append ( System . lineSeparator ( ) ) ; sb . append ( "  Target area:  " ) ; sb . append ( update_area ) ; sb . append ( System . lineSeparator ( ) ) ; throw new RangeCheckException ( sb . toString ( ) ) ; } final long width = update_area . width ( ) ; final long height = update_area . height ( ) ; final int bpp = t . format ( ) . getBytesPerPixel ( ) ; final long size = width * height * ( long ) bpp ; final ByteBuffer data = ByteBuffer . allocateDirect ( Math . toIntExact ( size ) ) ; data . order ( ByteOrder . nativeOrder ( ) ) ; return new UpdateCube ( t , update_area , data ) ; }
Create a new update that will replace the given {@code area} of {@code t}.
{@code area} must be included within the area of {@code t}.

@param t           The texture
@param update_area The area that will be updated

@return A new update

@throws RangeCheckException Iff {@code area} is not included within {@code
t}