Examples of glGetUniformLocation()


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

    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.glGetUniformLocation()

  private int fetchUniformLocation (String name) {
    GL20 gl = Gdx.graphics.getGL20();
    int location;
    if ((location = uniforms.get(name, -1)) == -1) {
      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 javax.media.opengl.GL3.glGetUniformLocation()

    public void display(GLAutoDrawable drawable) {
        try {
            final GL3 gl = drawable.getGL().getGL3();
            shaderState.bind(gl);
            vao.bind(gl);
            int spaceshipLoc = gl.glGetUniformLocation(shaderProgram.program(), "spaceshipTex");
            gl.glUniform1i(spaceshipLoc, 0);
            gl.glActiveTexture(GL.GL_TEXTURE0);
            gl.glBindTexture(GL.GL_TEXTURE_2D, spaceshipTex.getTextureObject(gl));

            int explosionLoc = gl.glGetUniformLocation(shaderProgram.program(), "explosionTex");
View Full Code Here

Examples of javax.media.opengl.GL3.glGetUniformLocation()

            int spaceshipLoc = gl.glGetUniformLocation(shaderProgram.program(), "spaceshipTex");
            gl.glUniform1i(spaceshipLoc, 0);
            gl.glActiveTexture(GL.GL_TEXTURE0);
            gl.glBindTexture(GL.GL_TEXTURE_2D, spaceshipTex.getTextureObject(gl));

            int explosionLoc = gl.glGetUniformLocation(shaderProgram.program(), "explosionTex");
            gl.glUniform1i(explosionLoc, 1);
            gl.glActiveTexture(GL.GL_TEXTURE0 + 1);
            gl.glBindTexture(GL.GL_TEXTURE_2D, explosionTex.getTextureObject(gl));

            vertices.clear();
View Full Code Here

Examples of net.rim.device.api.opengles.GL20.glGetUniformLocation()

        _positionLoc = gl.glGetAttribLocation(_program, "position");
        _texCoordLoc = gl.glGetAttribLocation(_program, "texCoord");
        _normalLoc = gl.glGetAttribLocation(_program, "normal");

        // Get uniform locations
        _matrixLoc = gl.glGetUniformLocation(_program, "matrix");
        _lightDirectionLoc =
                gl.glGetUniformLocation(_program, "lightDirection");
        _lightAmbientLoc = gl.glGetUniformLocation(_program, "lightAmbient");
        _lightDiffuseLoc = gl.glGetUniformLocation(_program, "lightDiffuse");
        _textureLoc = gl.glGetUniformLocation(_program, "texture");
View Full Code Here

Examples of net.rim.device.api.opengles.GL20.glGetUniformLocation()

        _normalLoc = gl.glGetAttribLocation(_program, "normal");

        // Get uniform locations
        _matrixLoc = gl.glGetUniformLocation(_program, "matrix");
        _lightDirectionLoc =
                gl.glGetUniformLocation(_program, "lightDirection");
        _lightAmbientLoc = gl.glGetUniformLocation(_program, "lightAmbient");
        _lightDiffuseLoc = gl.glGetUniformLocation(_program, "lightDiffuse");
        _textureLoc = gl.glGetUniformLocation(_program, "texture");

        // Set uniform values
View Full Code Here

Examples of net.rim.device.api.opengles.GL20.glGetUniformLocation()

        // Get uniform locations
        _matrixLoc = gl.glGetUniformLocation(_program, "matrix");
        _lightDirectionLoc =
                gl.glGetUniformLocation(_program, "lightDirection");
        _lightAmbientLoc = gl.glGetUniformLocation(_program, "lightAmbient");
        _lightDiffuseLoc = gl.glGetUniformLocation(_program, "lightDiffuse");
        _textureLoc = gl.glGetUniformLocation(_program, "texture");

        // Set uniform values
        gl.glUniform1i(_textureLoc, 0);
View Full Code Here

Examples of net.rim.device.api.opengles.GL20.glGetUniformLocation()

        // Get uniform locations
        _matrixLoc = gl.glGetUniformLocation(_program, "matrix");
        _lightDirectionLoc =
                gl.glGetUniformLocation(_program, "lightDirection");
        _lightAmbientLoc = gl.glGetUniformLocation(_program, "lightAmbient");
        _lightDiffuseLoc = gl.glGetUniformLocation(_program, "lightDiffuse");
        _textureLoc = gl.glGetUniformLocation(_program, "texture");

        // Set uniform values
        gl.glUniform1i(_textureLoc, 0);
View Full Code Here

Examples of net.rim.device.api.opengles.GL20.glGetUniformLocation()

        _matrixLoc = gl.glGetUniformLocation(_program, "matrix");
        _lightDirectionLoc =
                gl.glGetUniformLocation(_program, "lightDirection");
        _lightAmbientLoc = gl.glGetUniformLocation(_program, "lightAmbient");
        _lightDiffuseLoc = gl.glGetUniformLocation(_program, "lightDiffuse");
        _textureLoc = gl.glGetUniformLocation(_program, "texture");

        // Set uniform values
        gl.glUniform1i(_textureLoc, 0);

        // Light direction (normalized)
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.