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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations