Developer Documentation
|
Public Member Functions | |
TextureData () | |
Constructor. | |
~TextureData () | |
Destructor. | |
virtual PerObjectData * | copyPerObjectData () |
Copy Function. More... | |
bool | textureExists (QString _textureName) |
Check if a texture exists. More... | |
bool | isEnabled (QString _textureName) |
Check if a texture is enabled. More... | |
bool | enableTexture (QString _textureName, bool _exclusive=false) |
Enable a given texture. More... | |
void | disableTexture (QString _textureName) |
Disable a given texture. More... | |
int | addTexture (QString _textureName, uint _dimension, GLuint _glName) |
Add a Texture without file backing. | |
int | addTexture (QString _textureName, QString _filename, uint _dimension, GLuint _glName) |
Add a Texture. More... | |
int | addTexture (Texture _texture, GLuint _glName) |
Add a Texture ( Based on an existing specification ) | |
bool | addMultiTexture (QString _textureName) |
Adds a new multiTexture ( This texture will only contain a list of enabled textures for multitexturing ) | |
bool | setImage (QString _textureName, int _id) |
Stores the given image in the texture information. | |
Texture & | texture (QString _textureName) |
Get the texture object. More... | |
std::vector< Texture > & | textures () |
Get reference to the texture vector. More... | |
std::map< int, GLuint > * | textureMap () |
Get pointer to the textureMap. More... | |
std::map< int, std::string > * | propertyMap () |
Get pointer to the propertyMap. More... | |
Public Member Functions inherited from PerObjectData | |
PerObjectData () | |
You have to provide your own constructor for your object. | |
Private Member Functions | |
int | getTextureIndex (QString _textureName) |
Get the index of a given texture. More... | |
Private Attributes | |
std::map< int, GLuint > | textureMap_ |
std::map< int, std::string > | propertyMap_ |
int | nextInternalID_ |
internal id for the next texture | |
std::vector< Texture > | textures_ |
vector containing all textures of an object | |
Texture | noTexture |
Definition at line 189 of file TextureData.hh.
int TextureData::addTexture | ( | QString | _textureName, |
QString | _filename, | ||
uint | _dimension, | ||
GLuint | _glName | ||
) |
Add a Texture.
_textureName | name of the texture |
_filename | filename of the texture |
_dimension | dimension of the texture |
_glName | glName for the texture |
Definition at line 158 of file TextureData.cc.
|
inlinevirtual |
Copy Function.
You have to reimplement this function to allow the core to create a copies of your Object. By default it will return 0;
The function has to create a deep copy of the object, as it will also be used to create backups. If you use pointer inside your class, remember to not copy the pointer only but also the data!
Reimplemented from PerObjectData.
Definition at line 200 of file TextureData.hh.
void TextureData::disableTexture | ( | QString | _textureName | ) |
Disable a given texture.
_textureName | name of the texture |
Definition at line 140 of file TextureData.cc.
bool TextureData::enableTexture | ( | QString | _textureName, |
bool | _exclusive = false |
||
) |
Enable a given texture.
_textureName | name of the texture |
_exclusive | disable other textures? |
Definition at line 116 of file TextureData.cc.
|
private |
Get the index of a given texture.
_textureName | name of the texture |
Definition at line 290 of file TextureData.cc.
bool TextureData::isEnabled | ( | QString | _textureName | ) |
Check if a texture is enabled.
_textureName | name of the texture |
Definition at line 99 of file TextureData.cc.
std::map< int, std::string > * TextureData::propertyMap | ( | ) |
Get pointer to the propertyMap.
This map is used to store the available Textures and map them to their corresponding properties.
Definition at line 330 of file TextureData.cc.
Texture & TextureData::texture | ( | QString | _textureName | ) |
Get the texture object.
get texture object of a given texture
_textureName | name of the texture |
Definition at line 271 of file TextureData.cc.
bool TextureData::textureExists | ( | QString | _textureName | ) |
Check if a texture exists.
_textureName | name of the texture |
Definition at line 87 of file TextureData.cc.
std::map< int, GLuint > * TextureData::textureMap | ( | ) |
Get pointer to the textureMap.
This map maps all available textures for the object which this class belongs to to their GLuint. The MeshNode will use this map to activate one texture for each face.
Definition at line 320 of file TextureData.cc.
std::vector< Texture > & TextureData::textures | ( | ) |
Get reference to the texture vector.
Definition at line 310 of file TextureData.cc.