All Known Implementing Classes:
GlslExpr.Access, GlslExpr.Binary, GlslExpr.Clamp, GlslExpr.FunctionCall, GlslExpr.FunctionCall0, GlslExpr.RawLiteral, GlslExpr.Swizzle, GlslExpr.Variable

public interface GlslExpr
  • Method Details

    • variable

      static GlslExpr.Variable variable(String name)
      Create a glsl variable with the given name.
      Parameters:
      name - The name of the variable.
      Returns:
      A new variable expression.
    • call

      static GlslExpr.FunctionCall call(String functionName, GlslExpr... args)
    • call

      static GlslExpr.FunctionCall call(String functionName, Collection<? extends GlslExpr> args)
    • call

      static GlslExpr.FunctionCall0 call(String functionName)
    • intLiteral

      static GlslExpr intLiteral(int expr)
    • uintLiteral

      static GlslExpr uintLiteral(int expr)
    • uintHexLiteral

      static GlslExpr uintHexLiteral(int expr)
    • boolLiteral

      static GlslExpr boolLiteral(boolean expr)
    • floatLiteral

      static GlslExpr floatLiteral(float expr)
    • callFunction

      default GlslExpr.FunctionCall callFunction(String name)
      Call a one-parameter function with the given name on this expression.
      Parameters:
      name - The name of the function to call.
      Returns:
      A new glsl function call expression.
    • cast

      default GlslExpr.FunctionCall cast(String name)
    • swizzle

      default GlslExpr.Swizzle swizzle(String selection)
      Swizzle the components of this expression.
      Parameters:
      selection - The components to select. For example, "xyz", "zyx", or "zzzw".
      Returns:
      A new glsl swizzle expression.
    • access

      default GlslExpr.Access access(String member)
      Access the given member of this expression.
      Parameters:
      member - The name of the member to access.
      Returns:
      A new glsl member access expression.
    • transform

      default GlslExpr transform(Function<GlslExpr,GlslExpr> f)
      Catchall method for applying external transformations to this expression.
      Parameters:
      f - The transformation to apply.
      Returns:
      A new expression.
    • div

      default GlslExpr div(float v)
    • sub

      default GlslExpr sub(int v)
    • rsh

      default GlslExpr rsh(int by)
    • and

      default GlslExpr and(int mask)
    • xor

      default GlslExpr xor(int mask)
    • clamp

      default GlslExpr clamp(float from, float to)
    • prettyPrint

      String prettyPrint()