Var
Engine/source/shaderGen/langElement.h
Public Attributes
Public Static Attributes
Public Static Functions
getTexUnitNum(U32 numElements)
Public Functions
Detailed Description
Var - Variable - used to specify a variable to be used in a shader. Var stores information such that when it is printed out, its context can be identified and the proper information will automatically be printed. For instance, if a variable is created with 'uniform' set to true, when the shader function definition is printed, it will automatically add that variable to the incoming parameters of the shader. There are several similar cases such as when a new variable is declared within a shader.
example:
Var *modelview = new Var; modelview->setType( "float4x4" ); modelview->setName( "modelview" ); modelview->uniform = true; modelview->constSortPos = cspPass;
it prints out in the shader declaration as:
ConnectData main( VertData IN, uniform float4x4 modelview : register(C0) )
Public Attributes
U32 arraySize
char connectName [32]
bool connector
U32 constNum
ConstantSortPosition constSortPos
U32 rank
bool sampler
U8 structName [32]
U32 texCoordNum
bool texture
U8 type [32]
bool uniform
bool vertData
Public Static Attributes
U32 texUnitCount
Public Static Functions
getTexUnitNum(U32 numElements)
reset()
Public Functions
Var()
Var(const char * name, const char * type)
print(Stream & stream)
Reimplemented from: LangElement
setConnectName(const char * newName)
setStructName(const char * newName)
setType(const char * newType)
setUniform(const String & constType, const String & constName, ConstantSortPosition sortPos)