Example usage for com.badlogic.gdx.graphics GL20 glUniform1f

List of usage examples for com.badlogic.gdx.graphics GL20 glUniform1f

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL20 glUniform1f.

Prototype

public void glUniform1f(int location, float x);

Source Link

Usage

From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java

License:Apache License

/** Sets the uniform with the given name. The {@link ShaderProgram} must be bound for this to work.
 * /*from  w  ww  .  j  a v a  2s.  co  m*/
 * @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);
}

From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java

License:Apache License

public void setUniformf(int location, float value) {
    GL20 gl = Gdx.gl20;
    checkManaged();//from  ww  w  .  ja v  a 2  s.co m
    gl.glUniform1f(location, value);
}