@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 = 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 = 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 = 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); }
private FloatBuffer toFloatBuffer (float v[], int offset, int count) { ensureBufferCapacity(count << 2); floatBuffer.clear(); floatBuffer.limit(count); floatBuffer.put(v, offset, count); floatBuffer.position(0); return floatBuffer; }
/** Sets an array of uniform matrices with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param buffer buffer containing the matrix data * @param transpose whether the uniform matrix should be transposed */ public void setUniformMatrix4fv (String name, FloatBuffer buffer, int count, boolean transpose) { GL20 gl = Gdx.gl20; checkManaged(); buffer.position(0); int location = fetchUniformLocation(name); gl.glUniformMatrix4fv(location, count, transpose, buffer); }
/** Sets an array of uniform matrices with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param buffer buffer containing the matrix data * @param transpose whether the uniform matrix should be transposed */ public void setUniformMatrix4fv (String name, FloatBuffer buffer, int count, boolean transpose) { GL20 gl = Gdx.gl20; checkManaged(); buffer.position(0); int location = fetchUniformLocation(name); gl.glUniformMatrix4fv(location, count, transpose, buffer); }
@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(); }
/** Sets an array of uniform matrices with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param buffer buffer containing the matrix data * @param transpose whether the uniform matrix should be transposed */ public void setUniformMatrix3fv (String name, FloatBuffer buffer, int count, boolean transpose) { GL20 gl = Gdx.gl20; checkManaged(); buffer.position(0); int location = fetchUniformLocation(name); gl.glUniformMatrix3fv(location, count, transpose, buffer); }
@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(); }
/** Sets an array of uniform matrices with the given name. The {@link ShaderProgram} must be bound for this to work. * * @param name the name of the uniform * @param buffer buffer containing the matrix data * @param transpose whether the uniform matrix should be transposed */ public void setUniformMatrix3fv (String name, FloatBuffer buffer, int count, boolean transpose) { GL20 gl = Gdx.gl20; checkManaged(); buffer.position(0); int location = fetchUniformLocation(name); gl.glUniformMatrix3fv(location, count, transpose, buffer); }
public Float32Array copy (FloatBuffer buffer) { if (GWT.isProdMode()) { return ((Float32Array)((HasArrayBufferView)buffer).getTypedArray()).subarray(buffer.position(), buffer.remaining()); } else { ensureCapacity(buffer); for (int i = buffer.position(), j = 0; i < buffer.limit(); i++, j++) { floatBuffer.set(j, buffer.get(i)); } return floatBuffer.subarray(0, buffer.remaining()); } }
public Float32Array copy (FloatBuffer buffer) { if (GWT.isProdMode()) { return ((Float32Array)((HasArrayBufferView)buffer).getTypedArray()).subarray(buffer.position(), buffer.remaining()); } else { ensureCapacity(buffer); for (int i = buffer.position(), j = 0; i < buffer.limit(); i++, j++) { floatBuffer.set(j, buffer.get(i)); } return floatBuffer.subarray(0, buffer.remaining()); } }