Search in sources :

Example 36 with GL20

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

the class ShaderProgram method setUniform2fv.

public void setUniform2fv(String name, float[] values, int offset, int length) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchUniformLocation(name);
    gl.glUniform2fv(location, length / 2, values, offset);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 37 with GL20

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

the class ShaderProgram method setUniform4fv.

public void setUniform4fv(int location, float[] values, int offset, int length) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glUniform4fv(location, length / 4, values, offset);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 38 with GL20

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

the class ShaderProgram method dispose.

/** Disposes all resources associated with this shader. Must be called when the shader is no longer used. */
public void dispose() {
    GL20 gl = Gdx.gl20;
    gl.glUseProgram(0);
    gl.glDeleteShader(vertexShaderHandle);
    gl.glDeleteShader(fragmentShaderHandle);
    gl.glDeleteProgram(program);
    if (shaders.get(Gdx.app) != null)
        shaders.get(Gdx.app).removeValue(this, true);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 39 with GL20

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

the class ShaderProgram method enableVertexAttribute.

/** Enables the vertex attribute with the given name
	 * 
	 * @param name the vertex attribute name */
public void enableVertexAttribute(String name) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchAttributeLocation(name);
    if (location == -1)
        return;
    gl.glEnableVertexAttribArray(location);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 40 with GL20

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

the class ShaderProgram method enableVertexAttribute.

public void enableVertexAttribute(int location) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glEnableVertexAttribArray(location);
}
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