OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::RTShader::SubRenderStateFactory Class Referenceabstract

Abstract factory interface for creating SubRenderState implementation instances. More...

#include <OgreShaderSubRenderState.h>

+ Inheritance diagram for Ogre::RTShader::SubRenderStateFactory:
+ Collaboration diagram for Ogre::RTShader::SubRenderStateFactory:

Public Member Functions

 SubRenderStateFactory ()
 
virtual ~SubRenderStateFactory ()
 
virtual SubRenderStatecreateInstance ()
 Create an instance of the SubRenderState sub class it suppose to create. More...
 
virtual SubRenderStatecreateInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, Pass *pass, SGScriptTranslator *translator)
 Create an instance of the SubRenderState based on script properties. More...
 
virtual SubRenderStatecreateInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, TextureUnitState *texState, SGScriptTranslator *translator)
 Create an instance of the SubRenderState based on script properties. More...
 
virtual SubRenderStatecreateOrRetrieveInstance (SGScriptTranslator *translator)
 Retrieve the previous instance the SRS in the script translator or create a new instance if not found. More...
 
virtual void destroyAllInstances ()
 Destroy all the instances that created by this factory. More...
 
virtual void destroyInstance (SubRenderState *subRenderState)
 Destroy the given instance. More...
 
virtual const StringgetType () const =0
 Get the type of this sub render state factory. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
virtual void writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, Pass *srcPass, Pass *dstPass)
 Write the given sub-render state instance using the material serializer. More...
 
virtual void writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, const TextureUnitState *srcTextureUnit, const TextureUnitState *dstTextureUnit)
 Write the given sub-render state instance using the material serializer. More...
 

Protected Member Functions

virtual SubRenderStatecreateInstanceImpl ()=0
 Create instance implementation method. More...
 

Protected Attributes

SubRenderStateSet mSubRenderStateList
 

Detailed Description

Abstract factory interface for creating SubRenderState implementation instances.

Remarks
Plugins or 3rd party applications can add new types of sub render states to the RTShader System by creating subclasses of the SubRenderState class. Because multiple instances of these sub class may be required, a factory class to manage the instances is also required.
SubRenderStateFactory subclasses must allow the creation and destruction of SubRenderState subclasses. They must also be registered with the ShaderGenerator::addSubRenderStateFactory. All factories have a type which identifies them and the sub class of SubRenderState they creates.

Definition at line 232 of file OgreShaderSubRenderState.h.

Constructor & Destructor Documentation

Ogre::RTShader::SubRenderStateFactory::SubRenderStateFactory ( )
inline

Definition at line 236 of file OgreShaderSubRenderState.h.

virtual Ogre::RTShader::SubRenderStateFactory::~SubRenderStateFactory ( )
virtual

Member Function Documentation

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstance ( )
virtual

Create an instance of the SubRenderState sub class it suppose to create.

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstance ( ScriptCompiler compiler,
PropertyAbstractNode prop,
Pass pass,
SGScriptTranslator translator 
)
inlinevirtual

Create an instance of the SubRenderState based on script properties.

This method is called in the context of script parsing and let this factory the opportunity to create custom SubRenderState instances based on extended script properties.

Parameters
compilerThe compiler instance.
propThe abstract property node.
passThe pass that is the parent context of this node.
translatorThe translator instance holding existing scripts.

Definition at line 258 of file OgreShaderSubRenderState.h.

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstance ( ScriptCompiler compiler,
PropertyAbstractNode prop,
TextureUnitState texState,
SGScriptTranslator translator 
)
inlinevirtual

Create an instance of the SubRenderState based on script properties.

This method is called in the context of script parsing and let this factory the opportunity to create custom SubRenderState instances based on extended script properties.

Parameters
compilerThe compiler instance.
propThe abstract property node.
texStateThe pass that is the parent context of this node.
translatorThe translator instance holding existing scripts.

Definition at line 268 of file OgreShaderSubRenderState.h.

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createInstanceImpl ( )
protectedpure virtual

Create instance implementation method.

Each sub class of this interface must implement this method in which it will allocate the specific sub class of the SubRenderState.

virtual SubRenderState* Ogre::RTShader::SubRenderStateFactory::createOrRetrieveInstance ( SGScriptTranslator translator)
virtual

Retrieve the previous instance the SRS in the script translator or create a new instance if not found.

Parameters
translatorThe translator instance holding existing scripts.
virtual void Ogre::RTShader::SubRenderStateFactory::destroyAllInstances ( )
virtual

Destroy all the instances that created by this factory.

virtual void Ogre::RTShader::SubRenderStateFactory::destroyInstance ( SubRenderState subRenderState)
virtual

Destroy the given instance.

Parameters
subRenderStateThe instance to destroy.
virtual const String& Ogre::RTShader::SubRenderStateFactory::getType ( ) const
pure virtual

Get the type of this sub render state factory.

Remarks
The type string should be the same as the type of the SubRenderState sub class it is going to create.
See also
SubRenderState::getType.
template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

virtual void Ogre::RTShader::SubRenderStateFactory::writeInstance ( MaterialSerializer ser,
SubRenderState subRenderState,
Pass srcPass,
Pass dstPass 
)
inlinevirtual

Write the given sub-render state instance using the material serializer.

This method is called in the context of material serialization. It is useful for integrating into bigger context of material exporters from various environment that want to take advantage of the RT Shader System. Sub classes of this interface should override in case they need to write custom properties into the script context.

Parameters
serThe material serializer instance.
subRenderStateThe sub render state instance to write down.
srcPassThe source pass.
dstPassThe generated shader based pass.

Definition at line 294 of file OgreShaderSubRenderState.h.

virtual void Ogre::RTShader::SubRenderStateFactory::writeInstance ( MaterialSerializer ser,
SubRenderState subRenderState,
const TextureUnitState srcTextureUnit,
const TextureUnitState dstTextureUnit 
)
inlinevirtual

Write the given sub-render state instance using the material serializer.

This method is called in the context of material serialization. It is useful for integrating into bigger context of material exporters from various environment that want to take advantage of the RT Shader System. Sub classes of this interface should override in case they need to write custom properties into the script context.

Parameters
serThe material serializer instance.
subRenderStateThe sub render state instance to write down.
srcTextureUnitThe source texture unit state.
dstTextureUnitThe generated shader based texture unit state.

Definition at line 305 of file OgreShaderSubRenderState.h.

Member Data Documentation

SubRenderStateSet Ogre::RTShader::SubRenderStateFactory::mSubRenderStateList
protected

Definition at line 316 of file OgreShaderSubRenderState.h.


The documentation for this class was generated from the following file: