@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;
}