Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.GL20.glBindBuffer()


      for (int i = 0; i < numAttributes; i++) {
        final int location = locations[i];
        if (location >= 0) shader.disableVertexAttribute(location);
      }
    }
    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
    isBound = false;
  }

  /** Invalidates the VertexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */
  public void invalidate () {
View Full Code Here


  public void dispose () {
    tmpHandle.clear();
    tmpHandle.put(bufferHandle);
    tmpHandle.flip();
    GL20 gl = Gdx.gl20;
    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
    gl.glDeleteBuffers(1, tmpHandle);
    bufferHandle = 0;
  }

  /** Returns the VBO handle
View Full Code Here

  @Override
  public void bind (ShaderProgram shader, int[] locations) {
    final GL20 gl = Gdx.gl20;

    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle);
    if (isDirty) {
      byteBuffer.limit(buffer.limit() * 4);
      gl.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage);
      isDirty = false;
    }
View Full Code Here

      for (int i = 0; i < numAttributes; i++) {
        final int location = locations[i];
        if (location >= 0) shader.disableVertexAttribute(location);
      }
    }
    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
    isBound = false;
  }

  /** Invalidates the VertexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */
  public void invalidate () {
View Full Code Here

  public void dispose () {
    tmpHandle.clear();
    tmpHandle.put(bufferHandle);
    tmpHandle.flip();
    GL20 gl = Gdx.gl20;
    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
    gl.glDeleteBuffers(1, tmpHandle);
    bufferHandle = 0;
    BufferUtils.disposeUnsafeByteBuffer(byteBuffer);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.