Enum ShaderType

java.lang.Object
java.lang.Enum<ShaderType>
com.codename1.gpu.shader.ShaderType
All Implemented Interfaces:
Comparable<ShaderType>

public enum ShaderType extends Enum<ShaderType>
The value type of a ShaderNode. Every shading language the backends target has these four, so a graph typed with them prints the same way on all of them.
  • Enum Constant Details

    • FLOAT

      public static final ShaderType FLOAT
      One float.
    • VEC2

      public static final ShaderType VEC2
      Two floats.
    • VEC3

      public static final ShaderType VEC3
      Three floats: a position, a direction or a colour.
    • VEC4

      public static final ShaderType VEC4
      Four floats: a colour with alpha, or a sampled texel.
  • Method Details

    • values

      public static ShaderType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ShaderType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getComponents

      public int getComponents()

      Returns the number of float components, 1 to 4.

      Returns

      the component count

    • ofComponents

      public static ShaderType ofComponents(int n)

      Returns the type with the given number of components.

      Parameters
      • n: 1 to 4
      Returns

      the matching type