dtCore::ShaderParamInt Class Reference

This class is a shader parameter containing a single integer value. More...

#include <shaderparamint.h>

Inheritance diagram for dtCore::ShaderParamInt:

dtCore::ShaderParameter dtCore::Base

List of all members.

Public Member Functions

 ShaderParamInt (const std::string &name)
 Constructs the integer paremter.
virtual const
ShaderParameter::ParamType
GetType () const
 Gets the type of this parameter.
virtual void AttachToRenderState (osg::StateSet &stateSet)
 Assigns the necessary uniform variables for this parameter to the render state.
virtual void Update ()
 Method called by the shader owning this parameter if it detects the parameter has changed state.
void SetValue (int newValue)
 Sets the integer point value represented by this parameter.
int GetValue () const
 Gets the current value in this parameter.
virtual ShaderParameterClone ()
 Makes a deep copy of the Shader Parameter.

Protected Member Functions

virtual ~ShaderParamInt ()


Detailed Description

This class is a shader parameter containing a single integer value.

Constructor & Destructor Documentation

dtCore::ShaderParamInt::ShaderParamInt ( const std::string &  name  ) 

Constructs the integer paremter.

Parameters:
name Name given to this parameter. If it is to be used in a hardware shader, this name must match the corresponding uniform variable in the shader.

dtCore::ShaderParamInt::~ShaderParamInt (  )  [protected, virtual]


Member Function Documentation

virtual const ShaderParameter::ParamType& dtCore::ShaderParamInt::GetType (  )  const [inline, virtual]

Gets the type of this parameter.

Implements dtCore::ShaderParameter.

void dtCore::ShaderParamInt::AttachToRenderState ( osg::StateSet &  stateSet  )  [virtual]

Assigns the necessary uniform variables for this parameter to the render state.

This allows the parameter to communicate to the underlying shader.

Implements dtCore::ShaderParameter.

void dtCore::ShaderParamInt::Update (  )  [virtual]

Method called by the shader owning this parameter if it detects the parameter has changed state.

This method when called, sends the current float value in this parameter to the hardware shader.

Implements dtCore::ShaderParameter.

void dtCore::ShaderParamInt::SetValue ( int  newValue  )  [inline]

Sets the integer point value represented by this parameter.

Parameters:
newValue The new value to set.

int dtCore::ShaderParamInt::GetValue (  )  const [inline]

Gets the current value in this parameter.

Returns:
The current integer value.

ShaderParameter * dtCore::ShaderParamInt::Clone (  )  [virtual]

Makes a deep copy of the Shader Parameter.

Used when a user assigns a shader to a node because we clone the template shader and its parameters. Note - Like Update(), this is a pure virtual method that must be implemented on each param.

Implements dtCore::ShaderParameter.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008