Var Struct Reference

#include <langElement.h>

Inheritance diagram for Var:

Inheritance graph
[legend]
List of all members.

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 Member Functions

 Var ()
void setStructName (const char *newName)
void setConnectName (const char *newName)
void setType (const char *newType)
virtual void print (Stream &stream)
void setUniform (const String &constType, const String &constName, ConstantSortPosition sortPos)

Static Public Member Functions

static U32 getTexUnitNum (U32 numElements=1)
static void reset ()

Public Attributes

U8 type [32]
U8 structName [32]
char connectName [32]
ConstantSortPosition constSortPos
U32 constNum
U32 texCoordNum
bool uniform
bool vertData
bool connector
bool sampler
bool mapsToSampler
U32 arraySize

Static Public Attributes

static U32 texUnitCount


Constructor & Destructor Documentation

Var::Var (  ) 


Member Function Documentation

static U32 Var::getTexUnitNum ( U32  numElements = 1  )  [static]

static void Var::reset (  )  [static]

void Var::setStructName ( const char *  newName  ) 

void Var::setConnectName ( const char *  newName  ) 

void Var::setType ( const char *  newType  ) 

virtual void Var::print ( Stream stream  )  [virtual]

Reimplemented from LangElement.

void Var::setUniform ( const String constType,
const String constName,
ConstantSortPosition  sortPos 
)


Member Data Documentation

char Var::connectName[32]