/** Unbinds this IndexBufferObject. */ public void unbind () { Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0); isBound = false; }
/** Unbinds this IndexBufferObject. */ public void unbind () { Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0); isBound = false; }
/** Disposes this IndexBufferObject and all its associated OpenGL resources. */ public void dispose () { GL20 gl = Gdx.gl20; gl.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0); gl.glDeleteBuffer(bufferHandle); bufferHandle = 0; } }
/** Disposes of all resources this VertexBufferObject uses. */ @Override public void dispose () { GL20 gl = Gdx.gl20; gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0); gl.glDeleteBuffer(bufferHandle); bufferHandle = 0; }
@Override public void glBindBuffer (int target, int buffer) { calls++; gl20.glBindBuffer(target, buffer); check(); }
/** Disposes of all resources this VertexBufferObject uses. */ @Override public void dispose () { GL20 gl = Gdx.gl20; gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0); gl.glDeleteBuffer(bufferHandle); bufferHandle = 0; }
private int createBufferObject () { int result = Gdx.gl20.glGenBuffer(); Gdx.gl20.glBindBuffer(GL20.GL_ARRAY_BUFFER, result); Gdx.gl20.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.capacity(), null, usage); Gdx.gl20.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0); return result; }
private int createBufferObject () { int result = Gdx.gl20.glGenBuffer(); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, result); Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.capacity(), null, usage); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0); return result; }
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; } }
/** Binds this IndexBufferObject for rendering with glDrawElements. */ public void bind () { if (bufferHandle == 0) throw new GdxRuntimeException("IndexBufferObject cannot be used after it has been disposed."); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, bufferHandle); if (isDirty) { byteBuffer.limit(buffer.limit() * 2); Gdx.gl20.glBufferSubData(GL20.GL_ELEMENT_ARRAY_BUFFER, 0, byteBuffer.limit(), byteBuffer); isDirty = false; } isBound = true; }
/** Disposes of all resources this VertexBufferObject uses. */ @Override public void dispose () { GL20 gl = Gdx.gl20; gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0); gl.glDeleteBuffer(bufferHandle); bufferHandle = 0; if (ownsBuffer) BufferUtils.disposeUnsafeByteBuffer(byteBuffer); } }
/** Binds this IndexBufferObject for rendering with glDrawElements. */ public void bind () { if (bufferHandle == 0) throw new GdxRuntimeException("No buffer allocated!"); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, bufferHandle); if (isDirty) { byteBuffer.limit(buffer.limit() * 2); Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } isBound = true; }
/** Binds this IndexBufferObject for rendering with glDrawElements. */ public void bind () { if (bufferHandle == 0) throw new GdxRuntimeException("No buffer allocated!"); Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, bufferHandle); if (isDirty) { byteBuffer.limit(buffer.limit() * 2); Gdx.gl20.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage); isDirty = false; } isBound = true; }
/** Disposes this IndexBufferObject and all its associated OpenGL resources. */ public void dispose () { Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0); Gdx.gl20.glDeleteBuffer(bufferHandle); bufferHandle = 0; BufferUtils.disposeUnsafeByteBuffer(byteBuffer); } }
/** Disposes this IndexBufferObject and all its associated OpenGL resources. */ public void dispose () { Gdx.gl20.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0); Gdx.gl20.glDeleteBuffer(bufferHandle); bufferHandle = 0; BufferUtils.disposeUnsafeByteBuffer(byteBuffer); } }
/** Disposes of all resources this VertexBufferObject uses. */ @Override public void dispose () { GL20 gl = Gdx.gl20; gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0); gl.glDeleteBuffer(bufferHandle); bufferHandle = 0; if (ownsBuffer) BufferUtils.disposeUnsafeByteBuffer(byteBuffer); } }
private void bindData (GL20 gl) { if (isDirty) { gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle); buffer.limit(buffer.limit()); gl.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); buffer.limit(buffer.limit()); gl.glBufferData(GL20.GL_ARRAY_BUFFER, buffer.limit(), buffer, usage); isDirty = false; } }