Rigs of Rods 2023.09
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes
Hydrax::TextureManager Class Reference

Class for manager Normal maps. More...

#include <TextureManager.h>

Public Types

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

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

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.

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.

◆ _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.

◆ 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.

◆ 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.

◆ 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.

◆ remove()

void Hydrax::TextureManager::remove ( )

Remove textures.

Definition at line 62 of file TextureManager.cpp.

◆ 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.

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: