Predefined key class for sf::Texture resources.
More...
List of all members.
Static Public Member Functions |
static TextureKey | FromSize (unsigned int width, unsigned int height, const std::string &tag="") |
| Load sf::Texture from size.
|
static TextureKey | FromFile (const std::string &fileName, const sf::IntRect &area=sf::IntRect(), const std::string &tag="") |
| Load sf::Texture from file name.
|
static TextureKey | FromMemory (const void *data, std::size_t size, const sf::IntRect &area=sf::IntRect(), const std::string &tag="") |
| Load sf::Texture from file in memory.
|
static TextureKey | FromImage (const sf::Image &image, const sf::IntRect &area=sf::IntRect(), const std::string &tag="") |
| Load sf::Texture from an existing sf::Image.
|
static TextureKey | FromStream (sf::InputStream &stream, const sf::IntRect &area=sf::IntRect(), const std::string &tag="") |
| Load sf::Texture from input stream.
|
Public Member Functions |
MovedPtr< sf::Texture, NoCopy > | Load () const |
| Loads the image as specified by the static functions.
|
void | Swap (TextureKey &other) |
| Exchanges the contents of *this with other.
|
Related Functions |
bool | thor::Resources::operator< (const TextureKey &lhs, const TextureKey &rhs) |
| Comparison operator for strict weak ordering.
|
void | thor::Resources::swap (TextureKey &lhs, TextureKey &rhs) |
| Swaps two sf::Texture resource keys.
|
Detailed Description
Predefined key class for sf::Texture resources.
You can use this class to specifiy the access and loading of sf::Texture resources in a ResourceManager.
Member Function Documentation
Load sf::Texture from file name.
- Parameters:
-
fileName | The name of the file from which you want to load the sf::Texture. |
area | Sub-rectangle of the image to load. |
tag | If an existing key has the same loading parameters, you can use this ID to create a distinct key. |
- See also:
- sf::Texture::LoadFromFile()
Load sf::Texture from an existing sf::Image.
- Parameters:
-
image | Image containing the pixels that are copied to the texture. |
area | Sub-rectangle of the image to load. |
tag | If an existing key has the same loading parameters, you can use this ID to create a distinct key. |
- See also:
- sf::Texture::LoadFromImage()
Load sf::Texture from file in memory.
- Parameters:
-
data | Pointer to the file data in memory. |
size | Size of the data to load, in bytes. |
area | Sub-rectangle of the image to load. |
tag | If an existing key has the same loading parameters, you can use this ID to create a distinct key. |
- See also:
- sf::Texture::LoadFromMemory()
Load sf::Texture from size.
- Parameters:
-
width,height | The size of the texture. |
tag | If an existing key has the same loading parameters, you can use this ID to create a distinct key. |
- See also:
- sf::Texture::Create()
Load sf::Texture from input stream.
- Parameters:
-
stream | Source stream to read from. |
area | Sub-rectangle of the image to load. |
tag | If an existing key has the same loading parameters, you can use this ID to create a distinct key. |
- See also:
- sf::Texture::LoadFromStream()
Loads the image as specified by the static functions.
- Returns:
- Movable smart pointer to the allocated sf::Texture, or null pointer at loading failure.
The documentation for this class was generated from the following file: