#include <shaderparamtexture.h>

Public Member Functions | |
| ShaderParamTexture (const std::string &name) | |
| Constructs the shader parameter. | |
| virtual const ShaderParameter::ParamType & | GetType () const =0 |
| Gets the type of this parameter. | |
| virtual void | AttachToRenderState (osg::StateSet &stateSet)=0 |
| Assigns the necessary texture states for this parameter to the render state. | |
| virtual void | Update ()=0 |
| Updates the texture states of the shader parameter. | |
| virtual ShaderParameter * | Clone ()=0 |
| Makes a deep copy of the Shader Parameter. | |
| virtual void | SetTexture (const std::string &path) |
| Sets the path to the texture to use for this parameter. | |
| const std::string & | GetTexture () const |
| Gets the current texture path string. | |
| void | SetAddressMode (const TextureAxis &axis, const AddressMode &mode) |
| Sets the texture addressing mode. | |
| const AddressMode & | GetAddressMode (const TextureAxis &axis) |
| Gets the address mode assigned to the specified texture axis. | |
| void | SetTextureUnit (unsigned int unit) |
| Sets the texture unit to use for this texture parameter. | |
| unsigned int | GetTextureUnit () const |
| Gets the texture unit currently assigned to this shader parameter. | |
| void | SetTextureSourceType (const TextureSourceType &type) |
| Sets the source texture type of this parameter. | |
| const TextureSourceType & | GetTextureSourceType () const |
| Gets the source texture type of this parameter. | |
Protected Member Functions | |
| virtual | ~ShaderParamTexture () |
| Cleans up the parameter. | |
| void | SetTextureObject (osg::Texture &tex) |
| Sets the texture state attribute used by this shader parameter. | |
| osg::Texture * | GetTextureObject () |
| Gets the texture object currently assigned to this shader parameter. | |
| bool | IsImageSourceDirty () const |
| Gets whether or not the image used by this texture has been changed. | |
| void | SetImageSourceDirty (bool flag) |
| Sets whether or not the image used by this texture has changed since the last update. | |
Protected Attributes | |
| bool | mImageSrcChanged |
| unsigned int | mTextureUnit |
| const AddressMode * | mTextureAddressMode [4] |
| const TextureSourceType * | mSourceType |
| dtCore::RefPtr< osg::Texture > | mTextureObject |
| std::string | mTexturePath |
Classes | |
| class | AddressMode |
| Specifies the different texture addressing or texture wrap modes that can be assigned to this parameter. More... | |
| class | TextureAxis |
| An enumeration of the four texture axis. More... | |
| class | TextureSourceType |
| This enumeration defines the different types of sources that may be used for a texture parameter. More... | |
A Texture parameter is a parameter that contains the information and state necessary to encapsulate a texture map and its associated properties.
| dtCore::ShaderParamTexture::ShaderParamTexture | ( | const std::string & | name | ) |
Constructs the shader parameter.
| name | The name of the shader parameter. |
| dtCore::ShaderParamTexture::~ShaderParamTexture | ( | ) | [protected, virtual] |
Cleans up the parameter.
| virtual const ShaderParameter::ParamType& dtCore::ShaderParamTexture::GetType | ( | ) | const [pure virtual] |
Gets the type of this parameter.
Implements dtCore::ShaderParameter.
Implemented in dtCore::ShaderParamTexture2D.
| virtual void dtCore::ShaderParamTexture::AttachToRenderState | ( | osg::StateSet & | stateSet | ) | [pure virtual] |
Assigns the necessary texture states for this parameter to the render state.
Implements dtCore::ShaderParameter.
Implemented in dtCore::ShaderParamTexture2D.
| virtual void dtCore::ShaderParamTexture::Update | ( | ) | [pure virtual] |
Updates the texture states of the shader parameter.
This includes changes to the texture source or texture addressing parameters.
Implements dtCore::ShaderParameter.
Implemented in dtCore::ShaderParamTexture2D.
| virtual ShaderParameter* dtCore::ShaderParamTexture::Clone | ( | ) | [pure 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.
Implemented in dtCore::ShaderParamTexture2D.
| virtual void dtCore::ShaderParamTexture::SetTexture | ( | const std::string & | path | ) | [inline, virtual] |
Sets the path to the texture to use for this parameter.
| path | The path to the texture file. Must be relative to the current delta3d data file path. |
Reimplemented in dtCore::ShaderParamTexture2D.
| const std::string& dtCore::ShaderParamTexture::GetTexture | ( | ) | const [inline] |
Gets the current texture path string.
| void dtCore::ShaderParamTexture::SetAddressMode | ( | const TextureAxis & | axis, | |
| const AddressMode & | mode | |||
| ) |
Sets the texture addressing mode.
This is applied when texture coordinates wishing to access this texture parameter fall outside of the range 0.0 - 1.0.
| axis | The axis enumeration to assign the address mode to. | |
| mode | The address mode enumeration to assign. |
Reimplemented in dtCore::ShaderParamTexture2D.
| const ShaderParamTexture::AddressMode & dtCore::ShaderParamTexture::GetAddressMode | ( | const TextureAxis & | axis | ) |
Gets the address mode assigned to the specified texture axis.
| axis | The texture axis to query. |
| void dtCore::ShaderParamTexture::SetTextureUnit | ( | unsigned int | unit | ) | [inline] |
Sets the texture unit to use for this texture parameter.
| unit | The texture unit. |
| unsigned int dtCore::ShaderParamTexture::GetTextureUnit | ( | ) | const [inline] |
Gets the texture unit currently assigned to this shader parameter.
| void dtCore::ShaderParamTexture::SetTextureSourceType | ( | const TextureSourceType & | type | ) | [inline] |
Sets the source texture type of this parameter.
| type | The source type. |
| const TextureSourceType& dtCore::ShaderParamTexture::GetTextureSourceType | ( | ) | const [inline] |
Gets the source texture type of this parameter.
| void dtCore::ShaderParamTexture::SetTextureObject | ( | osg::Texture & | tex | ) | [inline, protected] |
Sets the texture state attribute used by this shader parameter.
| tex | The texture state attribute to set. |
| osg::Texture* dtCore::ShaderParamTexture::GetTextureObject | ( | ) | [inline, protected] |
Gets the texture object currently assigned to this shader parameter.
| bool dtCore::ShaderParamTexture::IsImageSourceDirty | ( | ) | const [inline, protected] |
Gets whether or not the image used by this texture has been changed.
| void dtCore::ShaderParamTexture::SetImageSourceDirty | ( | bool | flag | ) | [inline, protected] |
Sets whether or not the image used by this texture has changed since the last update.
| flag | True if it has changed, false otherwise. |
bool dtCore::ShaderParamTexture::mImageSrcChanged [protected] |
unsigned int dtCore::ShaderParamTexture::mTextureUnit [protected] |
const AddressMode* dtCore::ShaderParamTexture::mTextureAddressMode[4] [protected] |
const TextureSourceType* dtCore::ShaderParamTexture::mSourceType [protected] |
dtCore::RefPtr<osg::Texture> dtCore::ShaderParamTexture::mTextureObject [protected] |
std::string dtCore::ShaderParamTexture::mTexturePath [protected] |