Example usage for org.lwjgl.opengl GL20 glGetActiveAttrib

List of usage examples for org.lwjgl.opengl GL20 glGetActiveAttrib

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL20 glGetActiveAttrib.

Prototype

@NativeType("void")
public static String glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index,
        @NativeType("GLsizei") int maxLength, @NativeType("GLint *") IntBuffer size,
        @NativeType("GLenum *") IntBuffer type) 

Source Link

Document

Returns information about an active attribute variable for the specified program object.

Usage

From source file:com.badlogic.gdx.backends.lwjgl3.Lwjgl3GL20.java

License:Apache License

public String glGetActiveAttrib(int program, int index, IntBuffer size, Buffer type) {
    IntBuffer typeTmp = BufferUtils.createIntBuffer(2);
    String name = GL20.glGetActiveAttrib(program, index, 256, size, typeTmp);
    size.put(typeTmp.get(0));/*from  www . j av  a 2  s .  c  o m*/
    if (type instanceof IntBuffer)
        ((IntBuffer) type).put(typeTmp.get(1));
    return name;
}

From source file:com.google.gapid.glviewer.gl.Shader.java

License:Apache License

private static Attribute[] getActiveAttributes(int program) {
    int maxAttribNameLength = GL20.glGetProgrami(program, GL20.GL_ACTIVE_ATTRIBUTE_MAX_LENGTH);
    int numAttributes = GL20.glGetProgrami(program, GL20.GL_ACTIVE_ATTRIBUTES);
    IntBuffer size = createIntBuffer(1), type = createIntBuffer(1);

    Attribute[] result = new Attribute[numAttributes];
    for (int i = 0; i < numAttributes; i++) {
        String name = GL20.glGetActiveAttrib(program, i, maxAttribNameLength, size, type);
        result[i] = new Attribute(GL20.glGetAttribLocation(program, name), name, type.get(0));
    }/* w w w  . j  a  va  2s.  c o m*/
    return result;
}

From source file:com.google.gapid.glviewer.gl.Util.java

License:Apache License

public static AttributeOrUniform[] getActiveAttributes(int program) {
    int maxAttribNameLength = getProgramiv(program, GL20.GL_ACTIVE_ATTRIBUTE_MAX_LENGTH);
    int numAttributes = getProgramiv(program, GL20.GL_ACTIVE_ATTRIBUTES);
    IntBuffer size = createIntBuffer(1), type = createIntBuffer(1);

    AttributeOrUniform[] result = new AttributeOrUniform[numAttributes];
    for (int i = 0; i < numAttributes; i++) {
        String name = GL20.glGetActiveAttrib(program, i, maxAttribNameLength, size, type);
        result[i] = new AttributeOrUniform(GL20.glGetAttribLocation(program, name), name, type.get(0),
                size.get(0));//from   w  ww. ja va  2  s  .  com
    }
    return result;
}