Search in sources :

Example 1 with GL20

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

the class IndexBufferObject method dispose.

/** Disposes this IndexBufferObject and all its associated OpenGL resources. */
public void dispose() {
    GL20 gl = Gdx.gl20;
    gl.glBindBuffer(GL20.GL_ELEMENT_ARRAY_BUFFER, 0);
    gl.glDeleteBuffer(bufferHandle);
    bufferHandle = 0;
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 2 with GL20

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

the class PolygonSpriteBatch method end.

@Override
public void end() {
    if (!drawing)
        throw new IllegalStateException("PolygonSpriteBatch.begin must be called before end.");
    if (vertexIndex > 0)
        flush();
    lastTexture = null;
    drawing = false;
    GL20 gl = Gdx.gl;
    gl.glDepthMask(true);
    if (isBlendingEnabled())
        gl.glDisable(GL20.GL_BLEND);
    if (customShader != null)
        customShader.end();
    else
        shader.end();
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 3 with GL20

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

the class ShaderProgram method setVertexAttribute.

public void setVertexAttribute(int location, int size, int type, boolean normalize, int stride, int offset) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glVertexAttribPointer(location, size, type, normalize, stride, offset);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 4 with GL20

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

the class ShaderProgram method setAttributef.

/** Sets the given attribute
	 * 
	 * @param name the name of the attribute
	 * @param value1 the first value
	 * @param value2 the second value
	 * @param value3 the third value
	 * @param value4 the fourth value */
public void setAttributef(String name, float value1, float value2, float value3, float value4) {
    GL20 gl = Gdx.gl20;
    int location = fetchAttributeLocation(name);
    gl.glVertexAttrib4f(location, value1, value2, value3, value4);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 5 with GL20

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

the class ShaderProgram method setUniform4fv.

public void setUniform4fv(String name, float[] values, int offset, int length) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchUniformLocation(name);
    gl.glUniform4fv(location, length / 4, values, offset);
}
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