Search in sources :

Example 1 with GLTexture

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

the class DefaultTextureBinder method bindTexture.

private final int bindTexture(final TextureDescriptor textureDesc, final boolean rebind) {
    final int idx, result;
    final GLTexture texture = textureDesc.texture;
    reused = false;
    switch(method) {
        case ROUNDROBIN:
            result = offset + (idx = bindTextureRoundRobin(texture));
            break;
        case WEIGHTED:
            result = offset + (idx = bindTextureWeighted(texture));
            break;
        default:
            return -1;
    }
    if (reused) {
        reuseCount++;
        if (rebind)
            texture.bind(result);
        else
            Gdx.gl.glActiveTexture(GL20.GL_TEXTURE0 + result);
    } else
        bindCount++;
    texture.unsafeSetWrap(textureDesc.uWrap, textureDesc.vWrap);
    texture.unsafeSetFilter(textureDesc.minFilter, textureDesc.magFilter);
    return result;
}
Also used : GLTexture(com.badlogic.gdx.graphics.GLTexture)

Aggregations

GLTexture (com.badlogic.gdx.graphics.GLTexture)1