List of all members | Public Member Functions
thor::BigTexture Class Reference

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.
 

Detailed Description

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.

Member Function Documentation

bool thor::BigTexture::loadFromFile ( const std::string &  filename)

Loads the texture from a file.

Parameters
filenameName of the file to load from.
bool thor::BigTexture::loadFromImage ( const sf::Image &  image)

Loads the texture from an image.

Parameters
imageThe 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.

Parameters
dataPointer to begin of the data.
sizeSize of data in bytes.
bool thor::BigTexture::loadFromStream ( sf::InputStream &  stream)

Loads the texture from a SFML input stream.

Parameters
streamReference to sf::InputStream which loads the data.
void thor::BigTexture::setSmooth ( bool  smooth)

Enables or disables SFML's smooth filter.

Parameters
smoothTrue to enable smoothing, false to disable it.

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