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