Examples of GL20


Examples of com.badlogic.gdx.graphics.GL20

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

Examples of com.badlogic.gdx.graphics.GL20

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

  public void setUniformi (int location, int value1, int value2, int value3) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glUniform3i(location, value1, value2, value3);
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

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

Examples of com.badlogic.gdx.graphics.GL20

    int location = fetchUniformLocation(name);
    gl.glUniform4i(location, value1, value2, value3, value4);
  }

  public void setUniformi (int location, int value1, int value2, int value3, int value4) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glUniform4i(location, value1, value2, value3, value4);
  }
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 setUniformf (String name, float value) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchUniformLocation(name);
    gl.glUniform1f(location, value);
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

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

  public void setUniformf (int location, float value) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glUniform1f(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 setUniformf (String name, float value1, float value2) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchUniformLocation(name);
    gl.glUniform2f(location, value1, value2);
  }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20

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

  public void setUniformf (int location, float value1, float value2) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glUniform2f(location, value1, value2);
  }
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
   * @param value3 the third value */
  public void setUniformf (String name, float value1, float value2, float value3) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchUniformLocation(name);
    gl.glUniform3f(location, value1, value2, value3);
  }
View Full Code Here

Examples of net.rim.device.api.opengles.GL20

    /**
     * @see net.rim.device.api.opengles.GLField#initialize(GL)
     */
    protected void initialize(final GL g) {
        final GL20 gl = (GL20) g;

        // Create geometry for drawing a cube
        _cube = new Cube();
        _cube.init(gl);

        // Initialize OpenGL state and load all OpenGL resources
        gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
        gl.glEnable(GL20.GL_DEPTH_TEST);
        gl.glEnable(GL20.GL_CULL_FACE);

        // Load the shaders
        _program =
                createShaderProgram(gl, getSource(VERTEX_SHADER),
                        getSource(FRAGMENT_SHADER));
        gl.glUseProgram(_program);

        // Get attribute locations
        _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");

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

        // Light direction (normalized)
        gl.glUniform3f(_lightDirectionLoc, 0.0f, 0.0f, -1.0f);

        // Ambient light color
        gl.glUniform3f(_lightAmbientLoc, 0.2f, 0.2f, 0.2f);

        // Diffuse light color
        gl.glUniform3f(_lightDiffuseLoc, 1.0f, 1.0f, 1.0f);

        // Load texture
        gl.glActiveTexture(GL20.GL_TEXTURE0);
        final EncodedImage encodedImage =
                EncodedImage.getEncodedImageResource("BlackBerry.png");
        createTexture(gl, encodedImage, GL20.GL_RGB,
                GL20.GL_UNSIGNED_SHORT_5_6_5);

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.