TGUI  0.9-dev
tgui::BackendTextureSFML Class Reference

Texture implementation that makes use of SFML. More...

#include </home/texus/Documents/TGUI-0.9/include/TGUI/Backend/Renderer/SFML-Graphics/BackendTextureSFML.hpp>

Inheritance diagram for tgui::BackendTextureSFML:
tgui::BackendTexture

Public Member Functions

 BackendTextureSFML ()
 Default constructor.
 
bool loadTextureOnly (Vector2u size, const std::uint8_t *pixels, bool smooth) override
 Loads the texture from an array of 32-bits RGBA pixels, but don't take ownership of the pixels. More...
 
void setSmooth (bool smooth) override
 Changes whether the smooth filter is enabled or not. More...
 
sf::Texture & getInternalTexture ()
 Returns a reference to the internal SFML texture. More...
 
const sf::Texture & getInternalTexture () const
 Returns a const reference to the internal SFML texture. More...
 
- Public Member Functions inherited from tgui::BackendTexture
virtual ~BackendTexture ()=default
 Virtual destructor.
 
bool load (Vector2u size, std::unique_ptr< std::uint8_t[]> pixels, bool smooth)
 Loads the texture from an array of 32-bits RGBA pixels. More...
 
virtual Vector2u getSize () const
 Returns the size of the entire image. More...
 
virtual bool isSmooth () const
 Returns whether the smooth filter is enabled or not. More...
 
bool isTransparentPixel (Vector2u pixel) const
 Checks if a certain pixel is transparent. More...
 

Detailed Description

Texture implementation that makes use of SFML.

Member Function Documentation

◆ getInternalTexture() [1/2]

sf::Texture & tgui::BackendTextureSFML::getInternalTexture ( )

Returns a reference to the internal SFML texture.

Returns
Reference to internal texture

◆ getInternalTexture() [2/2]

const sf::Texture & tgui::BackendTextureSFML::getInternalTexture ( ) const

Returns a const reference to the internal SFML texture.

Returns
Const reference to internal texture

◆ loadTextureOnly()

bool tgui::BackendTextureSFML::loadTextureOnly ( Vector2u  size,
const std::uint8_t *  pixels,
bool  smooth 
)
overridevirtual

Loads the texture from an array of 32-bits RGBA pixels, but don't take ownership of the pixels.

Parameters
sizeWidth and height of the image to create
pixelsPointer to array of size.x*size.y*4 bytes with RGBA pixels, or nullptr to create an empty texture
smoothShould the smooth filter be enabled or not?
Warning
Unlike the load function, loadTextureOnly won't store the pixels and isTransparentPixel thus won't work

Reimplemented from tgui::BackendTexture.

◆ setSmooth()

void tgui::BackendTextureSFML::setSmooth ( bool  smooth)
overridevirtual

Changes whether the smooth filter is enabled or not.

Parameters
smoothTrue if smoothing should be enabled, false if it should be disabled

Reimplemented from tgui::BackendTexture.


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