@Override public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); }
@Override public void updateIndices (int targetOffset, short[] indices, int offset, int count) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 2); BufferUtils.copy(indices, offset, byteBuffer, count); byteBuffer.position(pos); }
@Override public void updateIndices (int targetOffset, short[] indices, int offset, int count) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 2); BufferUtils.copy(indices, offset, byteBuffer, count); byteBuffer.position(pos); }
@Override public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); buffer.position(0); bufferChanged(); }
@Override public void setVertices (float[] vertices, int offset, int count) { BufferUtils.copy(vertices, byteBuffer, count, offset); buffer.position(0); buffer.limit(count); }
@Override public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); buffer.position(0); bufferChanged(); }
@Override public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = buffer.position(); buffer.position(targetOffset); BufferUtils.copy(vertices, sourceOffset, count, buffer); buffer.position(pos); bufferChanged(); }
@Override public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = buffer.position(); buffer.position(targetOffset); BufferUtils.copy(vertices, sourceOffset, count, buffer); buffer.position(pos); bufferChanged(); }
@Override public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); buffer.position(0); bufferChanged(); }
@Override public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; if (isDirect) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); } else throw new GdxRuntimeException("Buffer must be allocated direct."); // Should never happen bufferChanged(); }
@Override public void updateVertices (int targetOffset, float[] vertices, int sourceOffset, int count) { isDirty = true; if (isDirect) { final int pos = byteBuffer.position(); byteBuffer.position(targetOffset * 4); BufferUtils.copy(vertices, sourceOffset, count, byteBuffer); byteBuffer.position(pos); } else throw new GdxRuntimeException("Buffer must be allocated direct."); // Should never happen bufferChanged(); }
@Override public void setVertices(float[] vertices, int offset, int count) { isDirty = true; BufferUtils.copy(vertices, byteBuffer, count, offset); buffer.position(0); buffer.limit(count); bufferChanged(); }
@Override public void setVertices (float[] vertices, int offset, int count) { isDirty = true; BufferUtils.copy(vertices, byteBuffer, count, offset); buffer.position(0); buffer.limit(count); bufferChanged(); }
@Override public void setVertices (float[] vertices, int offset, int count) { isDirty = true; BufferUtils.copy(vertices, buffer, count, offset); buffer.position(0); buffer.limit(count); bufferChanged(); }
@Override public void setVertices (float[] vertices, int offset, int count) { isDirty = true; BufferUtils.copy(vertices, byteBuffer, count, offset); buffer.position(0); buffer.limit(count); bufferChanged(); }
@Override public void setVertices (float[] vertices, int offset, int count) { isDirty = true; BufferUtils.copy(vertices, byteBuffer, count, offset); buffer.position(0); buffer.limit(count); bufferChanged(); }
public Face newMemoryFace(byte[] data, int dataSize, int faceIndex) { ByteBuffer buffer = BufferUtils.newUnsafeByteBuffer(data.length); BufferUtils.copy(data, 0, buffer, data.length); return newMemoryFace(buffer, faceIndex); }
private IntBuffer toIntBuffer (int v[], int offset, int count) { ensureBufferCapacity(count << 2); intBuffer.clear(); com.badlogic.gdx.utils.BufferUtils.copy(v, count, offset, intBuffer); return intBuffer; }
private FloatBuffer toFloatBuffer (float v[], int offset, int count) { ensureBufferCapacity(count << 2); floatBuffer.clear(); com.badlogic.gdx.utils.BufferUtils.copy(v, floatBuffer, count, offset); return floatBuffer; }
private IntBuffer toIntBuffer (int v[], int offset, int count) { ensureBufferCapacity(count << 2); intBuffer.clear(); com.badlogic.gdx.utils.BufferUtils.copy(v, count, offset, intBuffer); return intBuffer; }