Examples of GL20


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

    if (!drawing) throw new IllegalStateException("PolygonSpriteBatch.begin must be called before end.");
    if (vertexIndex > 0) flush();
    lastTexture = null;
    drawing = false;

    GL20 gl = Gdx.gl;
    gl.glDepthMask(true);
    if (isBlendingEnabled()) gl.glDisable(GL20.GL_BLEND);

    if (customShader != null)
      customShader.end();
    else
      shader.end();
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

    isCompiled = true;
  }

  private int loadShader (int type, String source) {
    GL20 gl = Gdx.gl20;
    IntBuffer intbuf = BufferUtils.newIntBuffer(1);

    int shader = gl.glCreateShader(type);
    if (shader == 0) return -1;

    gl.glShaderSource(shader, source);
    gl.glCompileShader(shader);
    gl.glGetShaderiv(shader, GL20.GL_COMPILE_STATUS, intbuf);

    int compiled = intbuf.get(0);
    if (compiled == 0) {
// gl.glGetShaderiv(shader, GL20.GL_INFO_LOG_LENGTH, intbuf);
// int infoLogLength = intbuf.get(0);
// if (infoLogLength > 1) {
      String infoLog = gl.glGetShaderInfoLog(shader);
      log += infoLog;
// }
      return -1;
    }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

    return shader;
  }

  private int linkProgram () {
    GL20 gl = Gdx.gl20;
    int program = gl.glCreateProgram();
    if (program == 0) return -1;

    gl.glAttachShader(program, vertexShaderHandle);
    gl.glAttachShader(program, fragmentShaderHandle);
    gl.glLinkProgram(program);

    ByteBuffer tmp = ByteBuffer.allocateDirect(4);
    tmp.order(ByteOrder.nativeOrder());
    IntBuffer intbuf = tmp.asIntBuffer();

    gl.glGetProgramiv(program, GL20.GL_LINK_STATUS, intbuf);
    int linked = intbuf.get(0);
    if (linked == 0) {
// Gdx.gl20.glGetProgramiv(program, GL20.GL_INFO_LOG_LENGTH, intbuf);
// int infoLogLength = intbuf.get(0);
// if (infoLogLength > 1) {
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

  public boolean isCompiled () {
    return isCompiled;
  }

  private int fetchAttributeLocation (String name) {
    GL20 gl = Gdx.gl20;
    // -2 == not yet cached
    // -1 == cached but not found
    int location;
    if ((location = attributes.get(name, -2)) == -2) {
      location = gl.glGetAttribLocation(program, name);
      attributes.put(name, location);
    }
    return location;
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

  private int fetchUniformLocation (String name) {
    return fetchUniformLocation(name, pedantic);
  }

  public int fetchUniformLocation (String name, boolean pedantic) {
    GL20 gl = Gdx.gl20;
    // -2 == not yet cached
    // -1 == cached but not found
    int location;
    if ((location = uniforms.get(name, -2)) == -2) {
      location = gl.glGetUniformLocation(program, name);
      if (location == -1 && pedantic) throw new IllegalArgumentException("no uniform with name '" + name + "' in shader");
      uniforms.put(name, location);
    }
    return location;
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

   * {@link #begin()}/{@link #end()} block.
   *
   * @param name the name of the uniform
   * @param value the value */
  public void setUniformi (String name, int value) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchUniformLocation(name);
    gl.glUniform1i(location, value);
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

    int location = fetchUniformLocation(name);
    gl.glUniform1i(location, value);
  }

  public void setUniformi (int location, int value) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glUniform1i(location, value);
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

   *
   * @param name the name of the uniform
   * @param value1 the first value
   * @param value2 the second value */
  public void setUniformi (String name, int value1, int value2) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchUniformLocation(name);
    gl.glUniform2i(location, value1, value2);
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

    int location = fetchUniformLocation(name);
    gl.glUniform2i(location, value1, value2);
  }

  public void setUniformi (int location, int value1, int value2) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glUniform2i(location, value1, value2);
  }
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.