OGRE: Ogre::RTShader::TextureAtlasSamplerFactory Class Reference

| OGRE 2.2.4 Object-Oriented Graphics Rendering Engine

Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Ogre::RTShader::TextureAtlasSamplerFactory Class Reference
Core » RTShader

A factory that enables creation of TextureAtlasSampler instances. More...

`#include <OgreShaderExTextureAtlasSampler.h>`

Inheritance diagram for Ogre::RTShader::TextureAtlasSamplerFactory:
[legend]

## Classes
struct | TextureAtlasAttib

## Public Types
enum | IndexPositionMode { ipmRelative, ipmAbsolute }

## Public Member Functions
| TextureAtlasSamplerFactory ()
bool | addTexutreAtlasDefinition (const Ogre::String &filename, TextureAtlasTablePtr textureAtlasTable=TextureAtlasTablePtr())
| Adds a texture atlas definition from a stream. More...
bool | addTexutreAtlasDefinition (DataStreamPtr stream, TextureAtlasTablePtr textureAtlasTable=TextureAtlasTablePtr())
| Adds a texture atlas definition from a stream. More...
virtual SubRenderState * | createInstance ()
| Create an instance of the SubRenderState sub class it suppose to create. More...
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, Pass *pass, SGScriptTranslator *translator)
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, TextureUnitState *texState, SGScriptTranslator *translator)
| Create an instance of the SubRenderState based on script properties. More...
virtual SubRenderState * | createOrRetrieveInstance (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...
const TextureAtlasAttib & | getDefaultAtlasingAttributes () const
| Returns the default attributes of texture atlas processing. More...
const TextureAtlasTablePtr & | getTextureAtlasTable (const String &textureName) const
| Retrieve the texture atlas table information for a given texture. More...
virtual const String & | getType () const
bool | hasMaterialAtlasingAttributes (Ogre::Material *material, TextureAtlasAttib *attrib=NULL) const
| Tells whether a specific material has atlas attributes associated with it. More...
void | operator delete (void *ptr)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete (void *ptr, void *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz)
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 *ptr)
| placement operator new More...
void * | operator new[] (size_t sz)
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void | removeAllTextureAtlasTables ()
| Removes all texture atlas table information. More...
void | removeTextureAtlasTable (const String &textureName)
| Removes the texture atlas information from a given texture. More...
void | setDefaultAtlasingAttributes (IndexPositionMode mode, ushort offset, bool autoAdjustBorders)
| Set the default attributes concerning atlas texture processing. More...
void | setMaterialAtlasingAttributes (Ogre::Material *material, IndexPositionMode mode, ushort offset, bool autoAdjustBorders)
| Set the default attributes concerning atlas texture processing for a specific material. More...
void | setTextureAtlasTable (const String &textureName, const TextureAtlasTablePtr &atlasData, bool autoBorderAdjust=true)
| Set the texture atlas information for a given texture. 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...
virtual void | writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, Pass *srcPass, Pass *dstPass)

## Static Public Member Functions
static TextureAtlasSamplerFactory & | getSingleton (void)
static TextureAtlasSamplerFactory * | getSingletonPtr (void)

## Detailed Description

A factory that enables creation of TextureAtlasSampler instances.

Remarks
  Sub class of SubRenderStateFactory

## Member Enumeration Documentation

## ◆ IndexPositionMode

enum Ogre::RTShader::TextureAtlasSamplerFactory::IndexPositionMode

Enumerator
ipmRelative |
ipmAbsolute |

## Constructor & Destructor Documentation

## ◆ TextureAtlasSamplerFactory()

Ogre::RTShader::TextureAtlasSamplerFactory::TextureAtlasSamplerFactory | ( |  | ) |

## Member Function Documentation

## ◆ addTexutreAtlasDefinition() [1/2]

bool Ogre::RTShader::TextureAtlasSamplerFactory::addTexutreAtlasDefinition | ( | const Ogre::String & | filename,
|  | TextureAtlasTablePtr | textureAtlasTable = `TextureAtlasTablePtr()`
| ) |  |

Adds a texture atlas definition from a stream.

This function loads a texture atlas definition file from a stream. The accepted format for this file is the NVidia Texture Atlas Tools ".tai" file format. This file as

The ".tai" format consist of lines, where each line corresponds to a specific texture in the texture atlas. Each line has the following format:

# <original texture filename>/t/t<atlas filename>, <atlas idx>, <atlas type>, <woffset>, <hoffset>, <depth offset>, <width>, <height>

Parameters

  filename | The full path to the file containing a ".tai" format data.
  textureAtlasTable | A table into which the data in the stream will be filled. This parameter will be filled only if it is not null. The system factory keeps a copy of this information in any case.

## ◆ addTexutreAtlasDefinition() [2/2]

bool Ogre::RTShader::TextureAtlasSamplerFactory::addTexutreAtlasDefinition | ( | DataStreamPtr | stream,
|  | TextureAtlasTablePtr | textureAtlasTable = `TextureAtlasTablePtr()`
| ) |  |

Adds a texture atlas definition from a stream.

This function loads a texture atlas definition file from a stream. The accepted format for this file is the NVidia Texture Atlas Tools ".tai" file format. This file as

The ".tai" format consist of lines, where each line corresponds to a specific texture in the texture atlas. Each line has the following format:

# <original texture filename>/t/t<atlas filename>, <atlas idx>, <atlas type>, <woffset>, <hoffset>, <depth offset>, <width>, <height>

Parameters

  stream | A stream to a file containing ".tai" format data
  textureAtlasTable | A table into which the data in the stream will be filled. This parameter will be filled only if it is not null. The system factory keeps a copy of this information in any case.

## ◆ createInstance() [1/3]

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

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

## ◆ createInstance() [2/3]

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

See also
  SubRenderStateFactory::createInstance.

Reimplemented from Ogre::RTShader::SubRenderStateFactory.

## ◆ createInstance() [3/3]

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

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

  compiler | The compiler instance.
  prop | The abstract property node.
  texState | The pass that is the parent context of this node.
  translator | The translator instance holding existing scripts.

Reimplemented in Ogre::RTShader::FFPAlphaTestFactory, and Ogre::RTShader::LayeredBlendingFactory.

## ◆ createOrRetrieveInstance()

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

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

Parameters

  translator | The translator instance holding existing scripts.

## ◆ destroyAllInstances()

virtual void Ogre::RTShader::SubRenderStateFactory::destroyAllInstances | ( |  | ) |
| virtualinherited

Destroy all the instances that created by this factory.

## ◆ destroyInstance()

virtual void Ogre::RTShader::SubRenderStateFactory::destroyInstance | ( | SubRenderState * | subRenderState | ) |
| virtualinherited

Destroy the given instance.

Parameters

  subRenderState | The instance to destroy.

## ◆ getDefaultAtlasingAttributes()

const TextureAtlasAttib& Ogre::RTShader::TextureAtlasSamplerFactory::getDefaultAtlasingAttributes | ( |  | ) | const

Returns the default attributes of texture atlas processing.

See also
  setDefaultAtlasingAttributes

## ◆ getSingleton()

static TextureAtlasSamplerFactory& Ogre::RTShader::TextureAtlasSamplerFactory::getSingleton | ( | void |  | ) |
| static

## ◆ getSingletonPtr()

static TextureAtlasSamplerFactory* Ogre::RTShader::TextureAtlasSamplerFactory::getSingletonPtr | ( | void |  | ) |
| static

## ◆ getTextureAtlasTable()

const TextureAtlasTablePtr& Ogre::RTShader::TextureAtlasSamplerFactory::getTextureAtlasTable | ( | const String & | textureName | ) | const

Retrieve the texture atlas table information for a given texture.

Parameters

  textureName | Name of an atlas texture

## ◆ getType()

virtual const String& Ogre::RTShader::TextureAtlasSamplerFactory::getType | ( |  | ) | const
| virtual

See also
  SubRenderStateFactory::getType.

Implements Ogre::RTShader::SubRenderStateFactory.

## ◆ hasMaterialAtlasingAttributes()

bool Ogre::RTShader::TextureAtlasSamplerFactory::hasMaterialAtlasingAttributes | ( | Ogre::Material * | material,
|  | TextureAtlasAttib * | attrib = `NULL`
| ) |  | const

Tells whether a specific material has atlas attributes associated with it.

And returns the attributes to be used.

See also
  setMaterialAtlasingAttributes

## ◆ operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |
| inlineinherited

## ◆ operator delete() [2/3]

template<class Alloc >

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

## ◆ operator delete() [3/3]

template<class Alloc >

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

## ◆ operator delete[]() [1/2]

template<class Alloc >

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

## ◆ operator delete[]() [2/2]

template<class Alloc >

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

## ◆ operator new() [1/3]

template<class Alloc >

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

## ◆ operator new() [2/3]

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

## ◆ operator new() [3/3]

template<class Alloc >

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

placement operator new

## ◆ operator new[]() [1/2]

template<class Alloc >

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

## ◆ operator new[]() [2/2]

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

## ◆ removeAllTextureAtlasTables()

void Ogre::RTShader::TextureAtlasSamplerFactory::removeAllTextureAtlasTables | ( |  | ) |

Removes all texture atlas table information.

## ◆ removeTextureAtlasTable()

void Ogre::RTShader::TextureAtlasSamplerFactory::removeTextureAtlasTable | ( | const String & | textureName | ) |

Removes the texture atlas information from a given texture.

Parameters

  textureName | Name of an atlas texture

## ◆ setDefaultAtlasingAttributes()

void Ogre::RTShader::TextureAtlasSamplerFactory::setDefaultAtlasingAttributes | ( | IndexPositionMode | mode,
|  | ushort | offset,
|  | bool | autoAdjustBorders
| ) |  |

Set the default attributes concerning atlas texture processing.

Parameters

  mode | The index positioning mode. Tells relative to where the the texture coordinates containing the atlas image to use are positioned.
  offset | The index positioning offset. Tells the offset relative to the index positioning mode.
  autoAdjustBorders | Tells whether to automatically adjust the polled area in the texture relative to the used mipmap level.

See also
  TextureAtlasSampler

## ◆ setMaterialAtlasingAttributes()

void Ogre::RTShader::TextureAtlasSamplerFactory::setMaterialAtlasingAttributes | ( | Ogre::Material * | material,
|  | IndexPositionMode | mode,
|  | ushort | offset,
|  | bool | autoAdjustBorders
| ) |  |

Set the default attributes concerning atlas texture processing for a specific material.

Parameters

  material | The material to which to add the information
  mode | The index positioning mode. Tells relative to where the the texture coordinates containing the atlas image to use are positioned.
  offset | The index positioning offset. Tells the offset relative to the index positioning mode.
  autoAdjustBorders | Tells whether to automatically adjust the polled area in the texture relative to the used mipmap level.

See also
  TextureAtlasSampler

## ◆ setTextureAtlasTable()

void Ogre::RTShader::TextureAtlasSamplerFactory::setTextureAtlasTable | ( | const String & | textureName,
|  | const TextureAtlasTablePtr & | atlasData,
|  | bool | autoBorderAdjust = `true`
| ) |  |

Set the texture atlas information for a given texture.

Parameters

  textureName | Name of an atlas texture
  atlasData | A list of records containing the position and size of each texture in the atlas
  autoBorderAdjust | Sets whether to automatically adjust the image polling area for border issues.See the Border issues paragraph under the class documentation for more information.

## ◆ writeInstance() [1/2]

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

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

  ser | The material serializer instance.
  subRenderState | The sub render state instance to write down.
  srcTextureUnit | The source texture unit state.
  dstTextureUnit | The generated shader based texture unit state.

Reimplemented in Ogre::RTShader::FFPAlphaTestFactory, and Ogre::RTShader::LayeredBlendingFactory.

## ◆ writeInstance() [2/2]

virtual void Ogre::RTShader::TextureAtlasSamplerFactory::writeInstance | ( | MaterialSerializer * | ser,
|  | SubRenderState * | subRenderState,
|  | Pass * | srcPass,
|  | Pass * | dstPass
| ) |  |
| virtual

See also
  SubRenderStateFactory::writeInstance.

Reimplemented from Ogre::RTShader::SubRenderStateFactory.

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

- OgreShaderExTextureAtlasSampler.h