/** * Create a new update that will replace the entirety of one face of {@code * t}. * * @param t The texture * * @return A new update */ public static JCGLTextureCubeUpdateType newUpdateReplacingAllCube( final JCGLTextureCubeUsableType t) { NullCheck.notNull(t); return JCGLTextureUpdates.newUpdateReplacingAreaCube(t, t.textureGetArea()); }
NullCheck.notNull(area, "Area"); if (!area.isIncludedIn(t.textureGetArea())) { final String s = String.format( "Target area %s is not included within the texture's area %s", area, t.textureGetArea()); assert s != null; throw new RangeCheckException(s);
@Override public ByteBuffer textureCubeGetImageLH( final JCGLTextureUnitType unit, final JCGLCubeMapFaceLH face, final JCGLTextureCubeUsableType texture) throws JCGLException { NullCheck.notNull(texture); NullCheck.notNull(face); NullCheck.notNull(unit); LWJGL3Textures.checkTextureUnit(this.context, unit); LWJGL3Textures.checkTextureCube(this.context, texture); final JCGLTextureFormat format = texture.textureGetFormat(); final LWJGL3TextureSpec spec = LWJGL3TextureSpecs.getTextureSpec(format); final AreaInclusiveUnsignedLType area = texture.textureGetArea(); final long width = area.getRangeX().getInterval(); final long height = area.getRangeY().getInterval(); final ByteBuffer data = ByteBuffer.allocateDirect( (int) (width * height * (long) format.getBytesPerPixel())); data.order(ByteOrder.nativeOrder()); final int gface = LWJGL3TypeConversions.cubeFaceToGL(face); this.textureCubeBind(unit, texture); GL11.glGetTexImage( gface, 0, spec.getFormat(), spec.getType(), data); return data; }
final AreaInclusiveUnsignedLType texture_area = texture.textureGetArea();
update_area.isIncludedIn(texture.textureGetArea()), ignored -> "Update area must be included in texture area");