Search in sources :

Example 51 with GL20

use of com.badlogic.gdx.graphics.GL20 in project libgdx by libgdx.

the class VertexBufferObject method unbind.

@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;
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 52 with GL20

use of com.badlogic.gdx.graphics.GL20 in project libgdx by libgdx.

the class ShaderProgram method setUniformf.

public void setUniformf(int location, float value) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glUniform1f(location, value);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Aggregations

GL20 (com.badlogic.gdx.graphics.GL20)52 IntBuffer (java.nio.IntBuffer)3 VertexAttribute (com.badlogic.gdx.graphics.VertexAttribute)2 Cubemap (com.badlogic.gdx.graphics.Cubemap)1 ByteBuffer (java.nio.ByteBuffer)1