dtCore::ShaderParamFloat Class Reference

This class is a shader parameter containing a single floating point value. More...

#include <shaderparamfloat.h>

Inheritance diagram for dtCore::ShaderParamFloat:

dtCore::ShaderParameter dtCore::Base

List of all members.

Public Member Functions

 ShaderParamFloat (const std::string &name)
 Constructs the float 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 (float newValue)
 Sets the floating point value represented by this parameter.
float GetValue () const
 Gets the current value in this parameter.
virtual ShaderParameterClone ()
 Makes a deep copy of the Shader Parameter.

Protected Member Functions

virtual ~ShaderParamFloat ()


Detailed Description

This class is a shader parameter containing a single floating point value.

Constructor & Destructor Documentation

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

Constructs the float 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::ShaderParamFloat::~ShaderParamFloat (  )  [protected, virtual]


Member Function Documentation

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

Gets the type of this parameter.

Implements dtCore::ShaderParameter.

void dtCore::ShaderParamFloat::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::ShaderParamFloat::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::ShaderParamFloat::SetValue ( float  newValue  )  [inline]

Sets the floating point value represented by this parameter.

Parameters:
newValue The new value to set.

float dtCore::ShaderParamFloat::GetValue (  )  const [inline]

Gets the current value in this parameter.

Returns:
The current floating point value.

ShaderParameter * dtCore::ShaderParamFloat::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