Package com.google.android.exoplayer2.util

## Class GlUtil.Attribute

- java.lang.Object
- - com.google.android.exoplayer2.util.GlUtil.Attribute

- Enclosing class:
    GlUtil

      public static final class GlUtil.Attribute
      extends Object

  GL attribute, which can be attached to a buffer with `setBuffer(float[], int)`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `String` | `name` | The name of the attribute in the GLSL sources.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Attribute​(int program, int index)` | Creates a new GL attribute.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `bind()` | Sets the vertex attribute to whatever was attached via `setBuffer(float[], int)`.
    `void` | `setBuffer​(float[] buffer, int size)` | Configures `bind()` to attach vertices in `buffer` (each of size `size` elements) to this `GlUtil.Attribute`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### name

          public final String name

      The name of the attribute in the GLSL sources.

  - ### Constructor Detail

    - #### Attribute

          public Attribute​(int program,
                           int index)

      Creates a new GL attribute.
      Parameters:
        `program` - The identifier of a compiled and linked GLSL shader program.
        `index` - The index of the attribute. After this instance has been constructed, the name of the attribute is available via the `name` field.

  - ### Method Detail

    - #### setBuffer

          public void setBuffer​(float[] buffer,
                                int size)

      Configures `bind()` to attach vertices in `buffer` (each of size `size` elements) to this `GlUtil.Attribute`.
      Parameters:
        `buffer` - Buffer to bind to this attribute.
        `size` - Number of elements per vertex.

    - #### bind

          public void bind()

      Sets the vertex attribute to whatever was attached via `setBuffer(float[], int)`.

      Should be called before each drawing call.