Class VertexAttribute

java.lang.Object
com.codename1.gpu.VertexAttribute

public final class VertexAttribute extends Object
Describes a single attribute (position, normal, texture coordinate, color) within a VertexFormat. The engine derives the generated shader's vertex inputs from the attributes present in the format, which is why a fixed set of well known usages is used rather than free form names.
  • Constructor Details

    • VertexAttribute

      public VertexAttribute(VertexAttribute.Usage usage, int components)

      Creates a float backed attribute.

      Parameters
      • usage: the semantic usage of the attribute

      • components: the number of float components (1 to 4)

  • Method Details

    • getUsage

      public VertexAttribute.Usage getUsage()
      Returns the semantic usage of this attribute.
    • getComponents

      public int getComponents()
      Returns the number of float components in this attribute.