Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.GL20


    unbind(shader, null);
  }

  @Override
  public void unbind (final ShaderProgram shader, final int[] locations) {
    final GL20 gl = Gdx.gl20;
    final int numAttributes = attributes.size();
    if (locations == null) {
      for (int i = 0; i < numAttributes; i++) {
        shader.disableVertexAttribute(attributes.get(i).alias);
      }
    } else {
      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;
  }
View Full Code Here


  @Override
  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;
  }
View Full Code Here

    bind(shader, null);
  }

  @Override
  public void bind (final ShaderProgram shader, final int[] locations) {
    final GL20 gl = Gdx.gl20;
    final int numAttributes = attributes.size();
    byteBuffer.limit(buffer.limit() * 4);
    if (locations == null) {
      for (int i = 0; i < numAttributes; i++) {
        final VertexAttribute attribute = attributes.get(i);
View Full Code Here

    unbind(shader, null);
  }

  @Override
  public void unbind (ShaderProgram shader, int[] locations) {
    final GL20 gl = Gdx.gl20;
    final int numAttributes = attributes.size();
    if (locations == null) {
      for (int i = 0; i < numAttributes; i++) {
        shader.disableVertexAttribute(attributes.get(i).alias);
      }
View Full Code Here

    int location = fetchUniformLocation(name);
    gl.glUniformMatrix4fv(location, count, transpose, buffer);
  }

  public void setUniformMatrix4fv (int location, float[] values, int offset, int length) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    ensureBufferCapacity(length << 2);
    floatBuffer.clear();
    BufferUtils.copy(values, floatBuffer, length, offset);
    gl.glUniformMatrix4fv(location, length / 16, false, floatBuffer);
  }
View Full Code Here

    BufferUtils.copy(values, floatBuffer, length, offset);
    gl.glUniformMatrix4fv(location, length / 16, false, floatBuffer);
  }

  public void setUniformMatrix4fv (String name, float[] values, int offset, int length) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    ensureBufferCapacity(length << 2);
    floatBuffer.clear();
    BufferUtils.copy(values, floatBuffer, length, offset);
    int location = fetchUniformLocation(name);
    gl.glUniformMatrix4fv(location, length / 16, false, floatBuffer);
  }
View Full Code Here

   *           GL20.GL_UNSIGNED_SHORT,GL20.GL_FIXED, or GL20.GL_FLOAT. GL_FIXED will not work on the desktop
   * @param normalize whether fixed point data should be normalized. Will not work on the desktop
   * @param stride the stride in bytes between successive attributes
   * @param buffer the buffer containing the vertex attributes. */
  public void setVertexAttribute (String name, int size, int type, boolean normalize, int stride, Buffer buffer) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchAttributeLocation(name);
    if (location == -1) return;
    gl.glVertexAttribPointer(location, size, type, normalize, stride, buffer);
  }
View Full Code Here

    if (location == -1) return;
    gl.glVertexAttribPointer(location, size, type, normalize, stride, buffer);
  }

  public void setVertexAttribute (int location, int size, int type, boolean normalize, int stride, Buffer buffer) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glVertexAttribPointer(location, size, type, normalize, stride, buffer);
  }
View Full Code Here

   *           GL20.GL_UNSIGNED_SHORT,GL20.GL_FIXED, or GL20.GL_FLOAT. GL_FIXED will not work on the desktop
   * @param normalize whether fixed point data should be normalized. Will not work on the desktop
   * @param stride the stride in bytes between successive attributes
   * @param offset byte offset into the vertex buffer object bound to GL20.GL_ARRAY_BUFFER. */
  public void setVertexAttribute (String name, int size, int type, boolean normalize, int stride, int offset) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchAttributeLocation(name);
    if (location == -1) return;
    gl.glVertexAttribPointer(location, size, type, normalize, stride, offset);
  }
View Full Code Here

    if (location == -1) return;
    gl.glVertexAttribPointer(location, size, type, normalize, stride, offset);
  }

  public void setVertexAttribute (int location, int size, int type, boolean normalize, int stride, int offset) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glVertexAttribPointer(location, size, type, normalize, stride, offset);
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.GL20

Copyright © 2018 www.massapicom. 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.