Bromeon
Public Member Functions | Related Functions
thor::BigTexture Class Reference

Class for textures which are too big for sf::Texture. More...

List of all members.

Public Member Functions

void Swap (BigTexture &other)
 Swaps *this with other.
bool LoadFromImage (const sf::Image &image)
 Loads the texture from an image.
bool LoadFromFile (const std::string &filename)
 Loads the texture from a file.
bool LoadFromMemory (const void *data, std::size_t size)
 Loads the texture from RAM.
bool LoadFromStream (sf::InputStream &stream)
 Loads the texture from a SFML input stream.
unsigned int GetWidth () const
 Returns the texture width in pixels.
unsigned int GetHeight () const
 Returns the texture height in pixels.

Related Functions

void thor::swap (BigTexture &lhs, BigTexture &rhs)
 Exchanges the contents of two big textures.

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.

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