Search in sources :

Example 6 with GL20

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

the class IndexBufferObjectSubData 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 7 with GL20

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

the class ShaderProgram method disableVertexAttribute.

public void disableVertexAttribute(int location) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    gl.glDisableVertexAttribArray(location);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 8 with GL20

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

the class ShaderProgram method setUniformMatrix3fv.

/** Sets an array of uniform matrices with the given name. The {@link ShaderProgram} must be bound for this to work.
	 * 
	 * @param name the name of the uniform
	 * @param buffer buffer containing the matrix data
	 * @param transpose whether the uniform matrix should be transposed */
public void setUniformMatrix3fv(String name, FloatBuffer buffer, int count, boolean transpose) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    buffer.position(0);
    int location = fetchUniformLocation(name);
    gl.glUniformMatrix3fv(location, count, transpose, buffer);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 9 with GL20

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

the class ShaderProgram method setVertexAttribute.

/** Sets the vertex attribute with the given name. The {@link ShaderProgram} must be bound for this to work.
	 * 
	 * @param name the attribute name
	 * @param size the number of components, must be >= 1 and <= 4
	 * @param type the type, must be one of GL20.GL_BYTE, GL20.GL_UNSIGNED_BYTE, GL20.GL_SHORT,
	 *           GL20.GL_UNSIGNED_SHORT,GL20.GL_FIXED, or GL20.GL_FLOAT. GL_FIXED will not work on the desktop
	 * @param normalize whether fixed point data should be normalized. Will not work on the desktop
	 * @param stride the stride in bytes between successive attributes
	 * @param offset byte offset into the vertex buffer object bound to GL20.GL_ARRAY_BUFFER. */
public void setVertexAttribute(String name, int size, int type, boolean normalize, int stride, int offset) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchAttributeLocation(name);
    if (location == -1)
        return;
    gl.glVertexAttribPointer(location, size, type, normalize, stride, offset);
}
Also used : GL20(com.badlogic.gdx.graphics.GL20)

Example 10 with GL20

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

the class ShaderProgram method disableVertexAttribute.

/** Disables the vertex attribute with the given name
	 * 
	 * @param name the vertex attribute name */
public void disableVertexAttribute(String name) {
    GL20 gl = Gdx.gl20;
    checkManaged();
    int location = fetchAttributeLocation(name);
    if (location == -1)
        return;
    gl.glDisableVertexAttribArray(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