GenOp

Engine/source/shaderGen/shaderOp.h

More...

Private Types

Parent 

Private Attributes

Public Functions

GenOp(const char * statement, ... )
print(Stream & stream)

Detailed Description

GenOp - General Operation - Very useful for combining several variables into one LangElement statement. It uses an elipses as a parameter, so it can take as many variables as you can throw at it. It takes a string and parses it for the '@' symbol which it replaces with passed in parameters. Similar to the C statement printf(). Here's an example:

( assuming three variables var1, var2, var3 exist and their assigned names
  are var1Name, var2Name, and var3Name )

LangElement *statement = new GenOp( "  @ = @ * @.x + @.y;", var1, var1, var2, var3 );

The output in the shader file would be:

var1Name = var1Name * var2Name.x + var3Name.y;

Private Types

typedef ShaderOp Parent 

Private Attributes

Vector< LangElement * > mElemList 

Public Functions

GenOp(const char * statement, ... )

print(Stream & stream)

Reimplemented from: LangElement