Examples of GL20


Examples of com.badlogic.gdx.graphics.GL20

  public void end () {
    if (!drawing) throw new IllegalStateException("begin must be called before end.");
    drawing = false;

    shader.end();
    GL20 gl = Gdx.gl20;
    gl.glDepthMask(true);
    if (customShader != null)
      mesh.unbind(customShader);
    else
      mesh.unbind(shader);
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

        // it's an iPod or iPhone
        displayScaleFactor = config.displayScaleSmallScreenIfNonRetina;
      }
    }

    GL20 gl20 = new IOSGLES20();
   
    Gdx.gl = gl20;
    Gdx.gl20 = gl20;
   
    // setup libgdx
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

    buffer.position(0);
    buffer.limit(count);

    if (isBound) {
      if (Gdx.gl20 != null) {
        GL20 gl = Gdx.gl20;
        gl.glBufferData(GL20.GL_ARRAY_BUFFER, buffer.limit(), buffer, usage);
      } else {
        GL11 gl = Gdx.gl11;
        gl.glBufferData(GL11.GL_ARRAY_BUFFER, buffer.limit(), buffer, usage);
      }
      isDirty = false;
    }
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

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

    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle);
    if (isDirty) {
      gl.glBufferData(GL20.GL_ARRAY_BUFFER, buffer.limit(), buffer, usage);
      isDirty = false;
    }

    final int numAttributes = attributes.size();
    if (locations == null) {
View Full Code Here

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

Examples of com.badlogic.gdx.graphics.GL20

  public void dispose () {
    if (Gdx.gl20 != null) {
      tmpHandle.clear();
      tmpHandle.put(bufferHandle);
      tmpHandle.flip();
      GL20 gl = Gdx.gl20;
      gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
      gl.glDeleteBuffers(1, tmpHandle);
      bufferHandle = 0;
    } else {
      tmpHandle.clear();
      tmpHandle.put(bufferHandle);
      tmpHandle.flip();
      GL11 gl = Gdx.gl11;
      gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
      gl.glDeleteBuffers(1, tmpHandle);
      bufferHandle = 0;
    }
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

    if (isBound) {
      if (Gdx.gl11 != null) {
        GL11 gl = Gdx.gl11;
        gl.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, buffer.limit(), buffer, usage);
      } else if (Gdx.gl20 != null) {
        GL20 gl = Gdx.gl20;
        gl.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, buffer.limit(), buffer, usage);
      }
      isDirty = false;
    }
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

      if (isDirty) {
        gl.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, buffer.limit(), buffer, usage);
        isDirty = false;
      }
    } else {
      GL20 gl = Gdx.gl20;
      gl.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, bufferHandle);
      if (isDirty) {
        gl.glBufferData(GL20.GL_ELEMENT_ARRAY_BUFFER, buffer.limit(), buffer, usage);
        isDirty = false;
      }
    }
    isBound = true;
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

  public void dispose () {
    if (Gdx.gl20 != null) {
      tmpHandle.clear();
      tmpHandle.put(bufferHandle);
      tmpHandle.flip();
      GL20 gl = Gdx.gl20;
      gl.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0);
      gl.glDeleteBuffers(1, tmpHandle);
      bufferHandle = 0;
    } else if (Gdx.gl11 != null) {
      tmpHandle.clear();
      tmpHandle.put(bufferHandle);
      tmpHandle.flip();
      GL11 gl = Gdx.gl11;
      gl.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);
      gl.glDeleteBuffers(1, tmpHandle);
      bufferHandle = 0;
    }
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

        // it's an iPod or iPhone
        displayScaleFactor = config.displayScaleSmallScreenIfNonRetina;
      }
    }

    GL20 gl20 = new IOSGLES20();

    Gdx.gl = gl20;
    Gdx.gl20 = gl20;

    // setup libgdx
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.