TGUI  1.2.0
No Matches

Static Public Member Functions

static TGUI_NODISCARD std::shared_ptr< TextureData > getTexture (Texture &texture, const String &filename, bool smooth)
 Loads a texture.
static void copyTexture (const std::shared_ptr< TextureData > &textureDataToCopy)
 Shares the image with another texture.
static void removeTexture (const std::shared_ptr< TextureData > &textureDataToRemove)
 Removes the texture.
static TGUI_NODISCARD std::size_t getCachedImagesCount ()

Static Protected Attributes

static std::map< String, std::list< TextureDataHolder > > m_imageMap

Member Function Documentation

◆ copyTexture()

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

Shares the image with another texture.

textureDataToCopyThe original texture data that will now be reused

◆ getTexture()

static TGUI_NODISCARD std::shared_ptr< TextureData > tgui::TextureManager::getTexture ( Texture & texture,
const String & filename,
bool smooth )

Loads a texture.

textureThe texture object that will store the loaded image
filenameFilename of the image to load
smoothEnable smoothing on the texture

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

Texture data when loaded successfully, nullptr otherwise

◆ removeTexture()

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

Removes the texture.

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: