Class for textures which are too big for sf::Texture. More...
Public Member Functions | |
BigTexture () | |
Default constructor. | |
bool | loadFromImage (const sf::Image &image) |
Loads the texture from an image. More... | |
bool | loadFromFile (const std::string &filename) |
Loads the texture from a file. More... | |
bool | loadFromMemory (const void *data, std::size_t size) |
Loads the texture from RAM. More... | |
bool | loadFromStream (sf::InputStream &stream) |
Loads the texture from a SFML input stream. More... | |
sf::Vector2u | getSize () const |
Returns the texture width and height in pixels. | |
void | setSmooth (bool smooth) |
Enables or disables SFML's smooth filter. More... | |
bool | isSmooth () const |
Tells whether SFML's smooth filter is enabled or not. | |
Class for textures which are too big for sf::Texture.
sf::Texture cannot handle textures of which the size exceeds the hardware-given limit. Instead, you can use this class, which has a very similar interface to sf::Texture. Internally, the class splits the texture into smaller parts which are unproblematic for OpenGL. To display the texture on the screen, you can use thor::BigSprite.
bool thor::BigTexture::loadFromFile | ( | const std::string & | filename | ) |
Loads the texture from a file.
filename | Name of the file to load from. |
bool thor::BigTexture::loadFromImage | ( | const sf::Image & | image | ) |
Loads the texture from an image.
image | The sf::Image of which the pixels are loaded by the texture. |
bool thor::BigTexture::loadFromMemory | ( | const void * | data, |
std::size_t | size | ||
) |
Loads the texture from RAM.
data | Pointer to begin of the data. |
size | Size of data in bytes. |
bool thor::BigTexture::loadFromStream | ( | sf::InputStream & | stream | ) |
Loads the texture from a SFML input stream.
stream | Reference to sf::InputStream which loads the data. |
void thor::BigTexture::setSmooth | ( | bool | smooth | ) |
Enables or disables SFML's smooth filter.
smooth | True to enable smoothing, false to disable it. |