Class GlUtil.Attribute

    • 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.