Here's my code :
Code: Select all
// try to upload only the smallest rectangle containing modification
// here just upload half the texture data
PixelBox src;
src = mImage.getPixelBox();
src.right = part.right/2;
src.bottom = part.bottom/2;
src.left = part.left;
src.top = part.top;
src.front = part.front;
src.back = part.back;
Image::Box destbox;
destbox.right = src.right;
destbox.bottom = src.bottom;
destbox.left = src.left;
destbox.top = src.top;
destbox.front = src.front;
destbox.back = src.back;
mBuffer->lock(HardwareBuffer::HBL_DISCARD);
mBuffer->blitFromMemory (src, destbox);
mBuffer->unlock();
