Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
IWritableTextureSource Class Referenceabstract

#include <texturesource.h>

+ Inheritance diagram for IWritableTextureSource:
+ Collaboration diagram for IWritableTextureSource:

Public Member Functions

 IWritableTextureSource ()=default
 
virtual ~IWritableTextureSource ()=default
 
virtual void processQueue ()=0
 Fulfil texture requests from other threads.
 
virtual void insertSourceImage (const std::string &name, video::IImage *img)=0
 Inserts a source image.
 
virtual void rebuildImagesAndTextures ()=0
 Rebuilds all textures (in case-source images have changed)
 
- Public Member Functions inherited from ITextureSource
 ITextureSource ()=default
 
virtual ~ITextureSource ()=default
 
virtual u32 getTextureId (const std::string &image)=0
 Generates a texture string into a standard texture.
 
virtual std::string getTextureName (u32 id)=0
 Returns name of existing texture by ID.
 
virtual video::ITexture * getTexture (u32 id)=0
 Returns existing texture by ID.
 
virtual video::ITexture * addArrayTexture (const std::vector< std::string > &images, u32 *id=nullptr)=0
 Generates texture string(s) into an array texture.
 
video::ITexture * getTextureForMesh (const std::string &image, u32 *id=nullptr)
 Generates a texture string into a standard texture Filters will be applied to make the texture suitable for mipmapping and linear filtering during rendering.
 
virtual bool needFilterForMesh () const =0
 
virtual PalettegetPalette (const std::string &image)=0
 Returns a palette from the given texture string.
 
virtual bool isKnownSourceImage (const std::string &name)=0
 Check if given image name exists.
 
virtual core::dimension2du getTextureDimensions (const std::string &image)=0
 Return dimensions of a texture string (will avoid actually creating the texture)
 
virtual video::SColor getTextureAverageColor (const std::string &image)=0
 Return average color of a texture string.
 
virtual void setImageCaching (bool enabled)
 Enables or disables the caching of finished texture images.
 
virtual video::ITexture * getTexture (const std::string &name, u32 *id=nullptr)=0
 Generates a texture string into a standard texture.
 
- Public Member Functions inherited from ISimpleTextureSource
 ISimpleTextureSource ()=default
 
virtual ~ISimpleTextureSource ()=default
 

Additional Inherited Members

- Static Public Attributes inherited from ITextureSource
static constexpr const char * FILTER_FOR_MESH = "^[applyfiltersformesh"
 Filter needed for mesh-suitable textures, including leading ^.
 

Constructor & Destructor Documentation

◆ IWritableTextureSource()

IWritableTextureSource::IWritableTextureSource ( )
default

◆ ~IWritableTextureSource()

virtual IWritableTextureSource::~IWritableTextureSource ( )
virtualdefault

Member Function Documentation

◆ insertSourceImage()

virtual void IWritableTextureSource::insertSourceImage ( const std::string & name,
video::IImage * img )
pure virtual

Inserts a source image.

Must be called from the main thread. Takes ownership of img

Implemented in TextureSource.

Referenced by Client::loadMedia().

+ Here is the caller graph for this function:

◆ processQueue()

virtual void IWritableTextureSource::processQueue ( )
pure virtual

Fulfil texture requests from other threads.

Implemented in TextureSource.

Referenced by Game::processQueues(), and Game::shutdown().

+ Here is the caller graph for this function:

◆ rebuildImagesAndTextures()

virtual void IWritableTextureSource::rebuildImagesAndTextures ( )
pure virtual

Rebuilds all textures (in case-source images have changed)

Note
This won't invalidate old ITexture's, but may or may not reuse them. So you have to re-get all textures anyway.

Implemented in TextureSource.

Referenced by Client::afterContentReceived().

+ Here is the caller graph for this function:

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