TGUI  v0.6.10
Classes | Public Member Functions | List of all members
tgui::TextureManager Class Reference
Inheritance diagram for tgui::TextureManager:


struct  ImageMapData

Public Member Functions

bool getTexture (const std::string &filename, Texture &texture, const sf::IntRect &rect=sf::IntRect(0, 0, 0, 0))
 Loads a texture. More...
bool copyTexture (const Texture &textureToCopy, Texture &newTexture)
 Share the image with another texture. More...
void removeTexture (Texture &textureToRemove)
 Removes the texture. More...

Member Function Documentation

bool tgui::TextureManager::copyTexture ( const Texture textureToCopy,
Texture newTexture 

Share the image with another texture.

textureToCopyThe original texture.
newTextureThe texture that will get the same image as the texture that is being copied
bool tgui::TextureManager::getTexture ( const std::string &  filename,
Texture texture,
const sf::IntRect &  rect = sf::IntRect(0, 0, 0, 0) 

Loads a texture.

filenameFilename of the image to load.
textureThe texture object to store the loaded image.
rectLoad only part of the image. Don't pass this parameter if you want to load the full image.

The second time you call this function with the same filename, the previously loaded image will be reused.

void tgui::TextureManager::removeTexture ( Texture textureToRemove)

Removes the texture.

textureToRemoveThe texture that should be removed.

When no other texture is using the same image then the image will be removed from memory.

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