Public Types | Public Member Functions

IParameterManager Class Reference

This reference page is linked to from the following overview topics: Obtaining Shader Parameters.


Search for all occurrences

Detailed Description

A data management class for accessing data required for displaying real time effects.

An instance of this class is maintained by the DirectX 9 Shader material and is passed into the IEffectParser::PreRender() method. This allows the Effect Parsers to format the data accordingly based on the runtime active for the shader

#include <RTMax.h>

Inheritance diagram for IParameterManager:
Inheritance graph
[legend]

List of all members.

Public Types

enum   {
  kPType_Unknown, kPType_Float, kPType_Int, kPType_Bool,
  kPType_Point4, kPType_Matrix, kPType_Color, kPType_Struct,
  kPType_Texture
}

Public Member Functions

virtual  ~IParameterManager ()
  Destructor.
virtual int  GetNumberOfParams ()=0
  The total number of parameters maintained by the manager.
virtual MaxSemantics  GetParamSemantics (int index)=0
  The semantic for the parameter.
virtual const MCHAR *  GetParamName (int index)=0
  Retireve the name of the parameter.
virtual bool  GetParamData (LPVOID data, int index)=0
  Access to the actual data stored by the manager.
virtual bool  GetParamData (LPVOID data, const MCHAR *paramName)=0
  Access to the actual data stored by the manager.
virtual int  GetParamType (int index)=0
  Access the data type of the parameter.
virtual int  GetParamType (const MCHAR *parmName)=0
  Access the data type of the parameter.
virtual int  GetParamSize (int index)=0
  Access the data size of the parameter (mainly designed for kPType_Struct type)

Member Enumeration Documentation

anonymous enum

Constructor & Destructor Documentation

virtual ~IParameterManager ( ) [inline, virtual]

Destructor.

{;}

Member Function Documentation

virtual int GetNumberOfParams ( ) [pure virtual]

The total number of parameters maintained by the manager.

Returns:
The number of parameters
virtual MaxSemantics GetParamSemantics ( int  index ) [pure virtual]

The semantic for the parameter.

This will be the semantic usage found in the shader file when it is parsed by the system

Parameters:
index The index of the parameter to query
Returns:
An item from MaxSemantics representing the semantic found in the file
virtual const MCHAR* GetParamName ( int  index ) [pure virtual]

Retireve the name of the parameter.

This will be the name of the parameter found in the shader file

Parameters:
index The index of the parameter to query
Returns:
A string containing the name
virtual bool GetParamData ( LPVOID  data,
int  index 
) [pure virtual]

Access to the actual data stored by the manager.

This is the main access point for data retrieval. It is the calling code's responsibility to make sure there is enough space allocated to receive the data. This can be determined by calling GetParamType, which will return the data type. If it is a kPtype_Matrix, then internally this is stored as an 4x4 float array

Parameters:
data A pointer to a buffer to receive the data
index THe index of the parameter to query
Returns:
True/False depending if the parameter was found, and the data copied correctly
virtual bool GetParamData ( LPVOID  data,
const MCHAR *  paramName 
) [pure virtual]

Access to the actual data stored by the manager.

This is an access point for data retrieval. It is the calling code's responsibility to make sure there is enough space allocated to receive the data. This can be determined by calling GetParamType, which will return the data type. If it is a kPtype_Matrix, then internally this is stored as an 4x4 float array

Parameters:
data A pointer to a buffer to receive the data
paramName The name of the parameter to query
Returns:
True/False depending if the parameter was found, and the data copied correctly
virtual int GetParamType ( int  index ) [pure virtual]

Access the data type of the parameter.

This method returns the type of parameter. This will be one of the enumerated types define in IParameterManager, kPType_Matrix etc..

Parameters:
index The index of the parameter to query
Returns:
The parameter type
virtual int GetParamType ( const MCHAR *  parmName ) [pure virtual]

Access the data type of the parameter.

This method returns the type of parameter. This will be one of the enumerated types define in IParameterManager, kPType_Matrix etc..

Parameters:
parmName The name of the parameter to query
Returns:
The parameter type
virtual int GetParamSize ( int  index ) [pure virtual]

Access the data size of the parameter (mainly designed for kPType_Struct type)

This method returns the size of the parameter, in D3DXVECTOR4 (upper rounded to), or number of textures.

Parameters:
index The index of the parameter to query
Returns:
The parameter size

IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager
IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager IParameterManager