TGUI  v0.7.5
tgui::TextureManager Class Reference

Static Public Member Functions

static bool getTexture (Texture &texture, const std::string &filename, const sf::IntRect &partRect=sf::IntRect(0, 0, 0, 0))
 Loads a texture. More...
 
static void copyTexture (std::shared_ptr< TextureData > textureDataToCopy)
 Share the image with another texture. More...
 
static void removeTexture (std::shared_ptr< TextureData > textureDataToRemove)
 Removes the texture. More...
 

Member Function Documentation

◆ copyTexture()

static void tgui::TextureManager::copyTexture ( std::shared_ptr< TextureData >  textureDataToCopy)
static

Share the image with another texture.

Parameters
textureDataToCopyThe original texture data that will now be reused.

◆ getTexture()

static bool tgui::TextureManager::getTexture ( Texture texture,
const std::string &  filename,
const sf::IntRect &  partRect = sf::IntRect(0, 0, 0, 0) 
)
static

Loads a texture.

Parameters
textureThe texture object to store the loaded image.
filenameFilename of the image to load.
partRectLoad 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.

Returns
False when the image could not be loaded, true otherwise.

◆ removeTexture()

static void tgui::TextureManager::removeTexture ( std::shared_ptr< TextureData >  textureDataToRemove)
static

Removes the texture.

Parameters
textureDataToRemoveThe texture data 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: