TGUI  v0.5.2
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
tgui::TextureManager Struct Reference
Inheritance diagram for tgui::TextureManager:

Public Member Functions

virtual bool getTexture (const std::string &filename, sf::Texture *&textureToLoad)
 This will load a texture from a file an return it. More...
 
virtual bool copyTexture (sf::Texture *const textureToCopy, sf::Texture *&newTexture)
 Tell the event manager that the texture is now also used somewhere else and may thus not be deleted if only one of the places is done with it. More...
 
virtual void removeTexture (sf::Texture *&textureToRemove)
 When the texture is no longer needed then this function is called. More...
 
virtual bool isTransparentPixel (const sf::Texture *const texture, unsigned int x, unsigned int y)
 Checks if the color on the given position is transparent. More...
 

Member Function Documentation

virtual bool tgui::TextureManager::copyTexture ( sf::Texture *const  textureToCopy,
sf::Texture *&  newTexture 
)
virtual

Tell the event manager that the texture is now also used somewhere else and may thus not be deleted if only one of the places is done with it.

Regardless of what the function returns, NewTexture will be the same as TextureToCopy.

Remarks
You MUST call removeTexture when you don"t need the texture anymore (ONLY when function returned true).
Returns
virtual bool tgui::TextureManager::getTexture ( const std::string &  filename,
sf::Texture *&  textureToLoad 
)
virtual

This will load a texture from a file an return it.

If the texture was already loaded then it won't be loaded again and this function just returns the same texture.

Remarks
You MUST call removeTexture when you don"t need the texture anymore (ONLY when function returned true).
Returns
  • true when the image was loaded successfully
  • false when the image couldn't be loaded (probalby file not found)
virtual bool tgui::TextureManager::isTransparentPixel ( const sf::Texture *const  texture,
unsigned int  x,
unsigned int  y 
)
virtual

Checks if the color on the given position is transparent.

When the texture was not in the list (or when it is NULL), this function will always return false.

virtual void tgui::TextureManager::removeTexture ( sf::Texture *&  textureToRemove)
virtual

When the texture is no longer needed then this function is called.

When the same texture is still in use somewhere else then the texture will not be deleted.

Remarks
For EVERY call to getTexture or copyTexture (that returned true) this function MUST be called.

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