private void fetchAttributes() {
        int len = GL20.glGetProgrami(program, GL20.GL_ACTIVE_ATTRIBUTES);
        // max length of all uniforms stored in program
        int strLen = GL20.glGetProgrami(program, GL20.GL_ACTIVE_ATTRIBUTE_MAX_LENGTH);

        attributes = new Attrib[len];
        for (int i = 0; i < len; i++) {
            Attrib a = new Attrib();
            // TODO: use proper FloatBuffer method instead of these convenience
            // methods
            a.name = GL20.glGetActiveAttrib(program, i, strLen);
            a.size = GL20.glGetActiveAttribSize(program, i);
            a.type = GL20.glGetActiveAttribType(program, i);
            a.location = GL20.glGetAttribLocation(program, a.name);
            attributes[i] = a;
        }
    }