RigsofRods
Soft-body Physics Simulation
Public Types | Public Member Functions | Private Member Functions | Private Attributes
Hydrax::TextureManager Class Reference

Class for manager Normal maps. More...

#include <TextureManager.h>

+ Collaboration diagram for Hydrax::TextureManager:

Public Types

enum  TexturesID { TEX_NORMAL_ID = 0 }
 Textures enumeration. More...
 

Public Member Functions

 TextureManager (Hydrax *h)
 Constructor. More...
 
 ~TextureManager ()
 Destructor. More...
 
void create (const Size &Size)
 Create height and normal map textures. More...
 
void remove ()
 Remove textures. More...
 
bool update (const TexturesID &Id, Image &Image)
 Update. More...
 
Ogre::TexturePtr & getTexture (const TexturesID &Id)
 Get texture. More...
 
const Ogre::String & getTextureName (const TexturesID &Id) const
 Get texture's name. More...
 

Private Member Functions

bool _createTexture (Ogre::TexturePtr &Texture, const Ogre::String &Name, const Size &Size)
 Create an Ogre::Texture. More...
 
Ogre::TexturePtr _getTexture (const Ogre::String &Name)
 Get an Ogre::TexturePtr. More...
 
bool _updateNormalMap (Image &Image)
 Update normal map. More...
 

Private Attributes

Ogre::TexturePtr mTextures [1]
 Our Ogre::TexturePtr array. More...
 
Ogre::String mTextureNames [1]
 Our Ogre::String array for store texture's names. More...
 
bool mCreated
 Have been created already called? More...
 
HydraxmHydrax
 Hydrax main pointer. More...
 

Detailed Description

Class for manager Normal maps.

Definition at line 45 of file TextureManager.h.

Member Enumeration Documentation

◆ TexturesID

Textures enumeration.

Enumerator
TEX_NORMAL_ID 

Definition at line 50 of file TextureManager.h.

Constructor & Destructor Documentation

◆ TextureManager()

Hydrax::TextureManager::TextureManager ( Hydrax h)

Constructor.

Parameters
hHydrax main pointer

Definition at line 31 of file TextureManager.cpp.

◆ ~TextureManager()

Hydrax::TextureManager::~TextureManager ( )

Destructor.

Definition at line 43 of file TextureManager.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ _createTexture()

bool Hydrax::TextureManager::_createTexture ( Ogre::TexturePtr &  Texture,
const Ogre::String &  Name,
const Size Size 
)
private

Create an Ogre::Texture.

Parameters
TextureOur Ogre::TexturePtr
NameTexture's name
SizeTexture's size
Returns
false if there is a problem.

Definition at line 131 of file TextureManager.cpp.

+ Here is the caller graph for this function:

◆ _getTexture()

Ogre::TexturePtr Hydrax::TextureManager::_getTexture ( const Ogre::String &  Name)
private

Get an Ogre::TexturePtr.

Parameters
NameTexture's name
Returns
Our texture

◆ _updateNormalMap()

bool Hydrax::TextureManager::_updateNormalMap ( Image Image)
private

Update normal map.

Parameters
ImageUpdate image
Returns
false if something fails
Remarks
Image type will be Image::Type::TYPE_RGB

Definition at line 78 of file TextureManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

void Hydrax::TextureManager::create ( const Size Size)

Create height and normal map textures.

Parameters
SizeTextures's size

Definition at line 48 of file TextureManager.cpp.

+ Here is the call graph for this function:

◆ getTexture()

Ogre::TexturePtr& Hydrax::TextureManager::getTexture ( const TexturesID Id)
inline

Get texture.

Parameters
IdTexture Id ( TEX_NORMAL_ID )
Returns
Ogre::TexturePtr

Definition at line 96 of file TextureManager.h.

+ Here is the caller graph for this function:

◆ getTextureName()

const Ogre::String& Hydrax::TextureManager::getTextureName ( const TexturesID Id) const
inline

Get texture's name.

Parameters
IdTexture Id ( TEX_NORMAL_ID )
Returns
Texture's name

Definition at line 105 of file TextureManager.h.

+ Here is the caller graph for this function:

◆ remove()

void Hydrax::TextureManager::remove ( )

Remove textures.

Definition at line 62 of file TextureManager.cpp.

+ Here is the caller graph for this function:

◆ update()

bool Hydrax::TextureManager::update ( const TexturesID Id,
Image Image 
)
inline

Update.

Parameters
IdTexture's ID
ImageUpdate image
Returns
false if something fails
Remarks
If you need to update the texture with another way of data, get the Ogre::TexturePtr and modify it directly. Normal image will be Image::Type::TYPE_RGB [0,255] range

Definition at line 82 of file TextureManager.h.

+ Here is the call graph for this function:

Field Documentation

◆ mCreated

bool Hydrax::TextureManager::mCreated
private

Have been created already called?

Definition at line 138 of file TextureManager.h.

◆ mHydrax

Hydrax* Hydrax::TextureManager::mHydrax
private

Hydrax main pointer.

Definition at line 141 of file TextureManager.h.

◆ mTextureNames

Ogre::String Hydrax::TextureManager::mTextureNames[1]
private

Our Ogre::String array for store texture's names.

Definition at line 135 of file TextureManager.h.

◆ mTextures

Ogre::TexturePtr Hydrax::TextureManager::mTextures[1]
private

Our Ogre::TexturePtr array.

Definition at line 133 of file TextureManager.h.


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