private void bufferChanged () { if (isBound) { Gdx.gl20.glBufferData(GL20.GL_ARRAY_BUFFER, buffer.limit(), buffer, usage); isDirty = false; } }
@Override public void setVertices (float[] vertices, int offset, int count) { BufferUtils.copy(vertices, byteBuffer, count, offset); buffer.position(0); buffer.limit(count); }
private void bufferChanged () { if (isBound) { Gdx.gl20.glBufferData(GL20.GL_ARRAY_BUFFER, buffer.limit(), buffer, usage); isDirty = false; } }
private void bindData (GL20 gl) { if (isDirty) { gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle); byteBuffer.limit(buffer.limit() * 4); gl.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } }
private void bindData(GL20 gl) { if (isDirty) { gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle); byteBuffer.limit(buffer.limit() * 4); gl.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } }
private void bindData (GL20 gl) { if (isDirty) { gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle); byteBuffer.limit(buffer.limit() * 4); gl.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } }
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; }
@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, 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(); }
@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(); }
public Lwjgl3Controller(Lwjgl3ControllerManager manager, int index) { this.manager = manager; this.index = index; this.axisState = new float[GLFW.glfwGetJoystickAxes(index).limit()]; this.buttonState = new boolean[GLFW.glfwGetJoystickButtons(index).limit()]; this.hatState = new byte[GLFW.glfwGetJoystickHats(index).limit()]; this.name = GLFW.glfwGetJoystickName(index); }
/** Starts the definition of a new cache, allowing the add and {@link #endCache()} methods to be called. */ public void beginCache () { if (drawing) throw new IllegalStateException("end must be called before beginCache"); if (currentCache != null) throw new IllegalStateException("endCache must be called before begin."); int verticesPerImage = mesh.getNumIndices() > 0 ? 4 : 6; currentCache = new Cache(caches.size, mesh.getVerticesBuffer().limit()); caches.add(currentCache); mesh.getVerticesBuffer().compact(); }
/** Starts the definition of a new cache, allowing the add and {@link #endCache()} methods to be called. */ public void beginCache () { if (drawing) throw new IllegalStateException("end must be called before beginCache"); if (currentCache != null) throw new IllegalStateException("endCache must be called before begin."); int verticesPerImage = mesh.getNumIndices() > 0 ? 4 : 6; currentCache = new Cache(caches.size, mesh.getVerticesBuffer().limit()); caches.add(currentCache); mesh.getVerticesBuffer().compact(); }
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()); } }