Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

EffectWrapper Class Reference

Wraps vertex and fragment shader setup. Convinience class based upon effect framework interfaces. (See D3D9 Effect framework or CGFX.). More...

#include <OgreEffectWrapper.h>

List of all members.

Public Member Functions

bool BeginPass ()
 Begins a new pass.
void createMaterial (const String &materialName)
 Does a material setup by name.
 EffectWrapper (Material *material)
 Constructor.
 EffectWrapper ()
 Default constructor.
void EndPass ()
 Signals the ending of the pass.
MaterialPtr & getMaterial ()
 Retrieves the material pointer object of the material.
unsigned short GetNumTechniques (void) const
 Accessor for the number of techniques in the material.
bool SetColourValue (const String &name, const ColourValue &colour)
bool SetDoubleArray (const String &name, double *value, size_t count)
bool SetFloat (const String &name, float value)
bool SetFloatArray (const String &name, const float *value, size_t count)
void SetFragmentProgramParameters ()
 Switches to fragment program parameter setup.
bool SetInt (const String &name, int value)
bool SetIntArray (const String &name, const int *value, size_t count)
void setMaterial (Material *material)
 Does a material setup by pointer.
bool SetMatrix (const String &name, Matrix4 &value)
bool SetMatrixArray (const String &name, Matrix4 *value, size_t numEntries)
bool SetMatrixTranspose (const String &name, Matrix4 &value)
bool SetMatrixTransposeArray (const String &name, Matrix4 *value, size_t numEntries)
bool SetReal (const String &name, Real value)
void SetShadowCasterProgramParameters ()
 Switches to shadow caster program parameter setup.
void SetShadowReceiverProgramParameters ()
 Switches to shadow receiver program parameter setup.
bool SetTechniqueToUse (int numberOfTechnique)
 Setup for the material techniques.
bool SetTexture (int textureUnit, const String &textureName)
bool SetVector3 (const String &name, const Vector3 &vec)
bool SetVector4 (const String &name, const Vector4 &vec)
void SetVertexProgramParameters ()
 Switches to vertex program parameter setup.
 ~EffectWrapper ()
 Destructor.

Private Member Functions

bool validateSet ()
 Validates whether we can set a parameter to the material or no.

Private Attributes

bool canSetNewTechnique
 True if new technique could be set.
bool fragmentProgramParams
 True if parameters should be set for the fragment shader.
MaterialPtr material
 Pointer to the material instance.
int numberOfCurrentPass
 Number of current pass.
int numberOfCurrentTechnique
 Number of current technique.
bool shadowCasterParams
 True if parameters should be set for the shadow caster shader program.
bool shadowReceiverParams
 True if parameters should be set for the shadow receiver shader program.
bool vertexProgramParams
 True if parameters should be set for the vertex shader.


Detailed Description

Wraps vertex and fragment shader setup. Convinience class based upon effect framework interfaces. (See D3D9 Effect framework or CGFX.).


Constructor & Destructor Documentation

EffectWrapper  ) 
 

Default constructor.

EffectWrapper Material *  material  ) 
 

Constructor.

Parameters:
material Material pointer to the Ogre material which the wrapper will use.

~EffectWrapper  ) 
 

Destructor.


Member Function Documentation

bool BeginPass  )  [inline]
 

Begins a new pass.

Returns:
Operation success or fail.

void createMaterial const String &  materialName  )  [inline]
 

Does a material setup by name.

Parameters:
name Material to create.

void EndPass  )  [inline]
 

Signals the ending of the pass.

MaterialPtr& getMaterial  ) 
 

Retrieves the material pointer object of the material.

Returns:
The material pointer object.

unsigned short GetNumTechniques void   )  const [inline]
 

Accessor for the number of techniques in the material.

Returns:
Number of techniques in the effect currently wrapped.

bool SetColourValue const String &  name,
const ColourValue &  colour
 

Parameters:
name Shader uniform parameter name.
colour Value of shader uniform parameter.
Returns:
Operation success or fail.

bool SetDoubleArray const String &  name,
double *  value,
size_t  count
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
count Count of data.
Returns:
Operation success or fail.

bool SetFloat const String &  name,
float  value
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
Returns:
Operation success or fail.

bool SetFloatArray const String &  name,
const float *  value,
size_t  count
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
count Count of data.
Returns:
Operation success or fail.

void SetFragmentProgramParameters  )  [inline]
 

Switches to fragment program parameter setup.

bool SetInt const String &  name,
int  value
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
Returns:
Operation success or fail.

bool SetIntArray const String &  name,
const int *  value,
size_t  count
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
count Count of data.
Returns:
Operation success or fail.

void setMaterial Material *  material  )  [inline]
 

Does a material setup by pointer.

Parameters:
material Material to wrap.

bool SetMatrix const String &  name,
Matrix4 &  value
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
Returns:
Operation success or fail.

bool SetMatrixArray const String &  name,
Matrix4 *  value,
size_t  numEntries
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
numEntries Count of data.
Returns:
Operation success or fail.

bool SetMatrixTranspose const String &  name,
Matrix4 &  value
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
Returns:
Operation success or fail.

bool SetMatrixTransposeArray const String &  name,
Matrix4 *  value,
size_t  numEntries
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
numEntries Count of data.
Returns:
Operation success or fail.

bool SetReal const String &  name,
Real  value
 

Parameters:
name Shader uniform parameter name.
value Value of shader uniform parameter.
Returns:
Operation success or fail.

void SetShadowCasterProgramParameters  )  [inline]
 

Switches to shadow caster program parameter setup.

void SetShadowReceiverProgramParameters  )  [inline]
 

Switches to shadow receiver program parameter setup.

bool SetTechniqueToUse int  numberOfTechnique  ) 
 

Setup for the material techniques.

Parameters:
numberOfTechnique Which technique to use.
Returns:
Operation success or fail.

bool SetTexture int  textureUnit,
const String &  textureName
 

Parameters:
textureUnit Which texture unit to populate with the texture.
textureName The name of the texture to use.
Returns:
Operation success or fail.

bool SetVector3 const String &  name,
const Vector3 &  vec
 

Parameters:
name Shader uniform parameter name.
vec Value of shader uniform parameter.
Returns:
Operation success or fail.

bool SetVector4 const String &  name,
const Vector4 &  vec
 

Parameters:
name Shader uniform parameter name.
vec Value of shader uniform parameter.
Returns:
Operation success or fail.

void SetVertexProgramParameters  )  [inline]
 

Switches to vertex program parameter setup.

bool validateSet  )  [inline, private]
 

Validates whether we can set a parameter to the material or no.

Returns:
Whether a parameter could be set.


Member Data Documentation

bool canSetNewTechnique [private]
 

True if new technique could be set.

bool fragmentProgramParams [private]
 

True if parameters should be set for the fragment shader.

MaterialPtr material [private]
 

Pointer to the material instance.

int numberOfCurrentPass [private]
 

Number of current pass.

int numberOfCurrentTechnique [private]
 

Number of current technique.

bool shadowCasterParams [private]
 

True if parameters should be set for the shadow caster shader program.

bool shadowReceiverParams [private]
 

True if parameters should be set for the shadow receiver shader program.

bool vertexProgramParams [private]
 

True if parameters should be set for the vertex shader.


The documentation for this class was generated from the following file:
Generated on Mon Apr 18 10:59:26 2005 for OGRE_IllumModule by  doxygen 1.4.2