/** * @return A shallow clone of this image. The data is not cloned. */ @Override public Image clone(){ Image clone = (Image) super.clone(); clone.mipMapSizes = mipMapSizes != null ? mipMapSizes.clone() : null; clone.data = data != null ? new ArrayList<ByteBuffer>(data) : null; clone.lastTextureState = new LastTextureState(); clone.setUpdateNeeded(); return clone; }
/** * Creates a deep clone of the {@link VertexBuffer}. * * @return Deep clone of this buffer */ @Override public VertexBuffer clone(){ // NOTE: Superclass GLObject automatically creates shallow clone // e.g re-use ID. VertexBuffer vb = (VertexBuffer) super.clone(); vb.handleRef = new Object(); vb.id = -1; if (data != null) { // Make sure to pass a read-only buffer to clone so that // the position information doesn't get clobbered by another // reading thread during cloning (and vice versa) since this is // a purely read-only operation. vb.updateData(BufferUtils.clone(getDataReadOnly())); } return vb; }
/** * @return A shallow clone of this image. The data is not cloned. */ @Override public Image clone(){ Image clone = (Image) super.clone(); clone.mipMapSizes = mipMapSizes != null ? mipMapSizes.clone() : null; clone.data = data != null ? new ArrayList<ByteBuffer>(data) : null; clone.setUpdateNeeded(); return clone; }
/** * Creates a deep clone of the {@link VertexBuffer}. * * @return Deep clone of this buffer */ @Override public VertexBuffer clone(){ // NOTE: Superclass GLObject automatically creates shallow clone // e.g re-use ID. VertexBuffer vb = (VertexBuffer) super.clone(); vb.handleRef = new Object(); vb.id = -1; if (data != null) vb.updateData(BufferUtils.clone(data)); return vb; }
/** * @return A shallow clone of this image. The data is not cloned. */ @Override public Image clone(){ Image clone = (Image) super.clone(); clone.mipMapSizes = mipMapSizes != null ? mipMapSizes.clone() : null; clone.data = data != null ? new ArrayList<ByteBuffer>(data) : null; clone.lastTextureState = new LastTextureState(); clone.setUpdateNeeded(); return clone; }
/** * Creates a deep clone of the {@link VertexBuffer}. * * @return Deep clone of this buffer */ @Override public VertexBuffer clone(){ // NOTE: Superclass GLObject automatically creates shallow clone // e.g re-use ID. VertexBuffer vb = (VertexBuffer) super.clone(); vb.handleRef = new Object(); vb.id = -1; if (data != null) { // Make sure to pass a read-only buffer to clone so that // the position information doesn't get clobbered by another // reading thread during cloning (and vice versa) since this is // a purely read-only operation. vb.updateData(BufferUtils.clone(getDataReadOnly())); } return vb; }