Example usage for com.badlogic.gdx.graphics GL20 glGetAttribLocation

List of usage examples for com.badlogic.gdx.graphics GL20 glGetAttribLocation

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL20 glGetAttribLocation.

Prototype

public int glGetAttribLocation(int program, String name);

Source Link

Usage

From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java

License:Apache License

private int fetchAttributeLocation(String name) {
    GL20 gl = Gdx.gl20;
    // -2 == not yet cached
    // -1 == cached but not found
    int location;
    if ((location = attributes.get(name, -2)) == -2) {
        location = gl.glGetAttribLocation(program, name);
        attributes.put(name, location);/*from  ww w .java  2s .c om*/
    }
    return location;
}