28#ifndef _TextureManager_H__
29#define _TextureManager_H__
353 return createManual(name,
group,
texType, width, height, 1,
479 return mDefaultNumMipmaps;
Class representing an image file.
Interface describing a manual resource loader.
Defines a generic resource handler.
std::pair< ResourcePtr, bool > ResourceCreateOrRetrieveResult
Template class for creating single-instance global classes.
Class for loading & managing textures.
virtual TexturePtr createManual(const String &name, const String &group, TextureType texType, uint width, uint height, uint depth, int numMipmaps, PixelFormat format, int usage=TU_DEFAULT, ManualResourceLoader *loader=0, bool hwGammaCorrection=false, uint fsaa=0, const String &fsaaHint=StringUtil::BLANK)
Create a manual texture with specified width, height and depth (not loaded from a file).
virtual ~TextureManager()
virtual bool isHardwareFilteringSupported(TextureType ttype, PixelFormat format, int usage, bool preciseFormatOnly=false)=0
Returns whether this render system has hardware filtering supported for the texture format requested ...
virtual TexturePtr load(const String &name, const String &group, TextureType texType=TEX_TYPE_2D, int numMipmaps=MIP_DEFAULT, Real gamma=1.0f, bool isAlpha=false, PixelFormat desiredFormat=PF_UNKNOWN, bool hwGammaCorrection=false)
Loads a texture from a file.
ushort mPreferredFloatBitDepth
virtual ushort getPreferredFloatBitDepth(void) const
Gets preferred bit depth for float pixel format textures.
virtual TexturePtr loadRawData(const String &name, const String &group, DataStreamPtr &stream, ushort width, ushort height, PixelFormat format, TextureType texType=TEX_TYPE_2D, int numMipmaps=MIP_DEFAULT, Real gamma=1.0f, bool hwGammaCorrection=false)
Loads a texture from a raw data stream.
virtual ResourceCreateOrRetrieveResult createOrRetrieve(const String &name, const String &group, bool isManual=false, ManualResourceLoader *loader=0, const NameValuePairList *createParams=0, TextureType texType=TEX_TYPE_2D, int numMipmaps=MIP_DEFAULT, Real gamma=1.0f, bool isAlpha=false, PixelFormat desiredFormat=PF_UNKNOWN, bool hwGammaCorrection=false)
Create a new texture, or retrieve an existing one with the same name if it already exists.
size_t mDefaultNumMipmaps
virtual size_t getDefaultNumMipmaps()
Gets the default number of mipmaps to be used for loaded textures.
static TextureManager * getSingletonPtr(void)
Override standard Singleton retrieval.
virtual TexturePtr prepare(const String &name, const String &group, TextureType texType=TEX_TYPE_2D, int numMipmaps=MIP_DEFAULT, Real gamma=1.0f, bool isAlpha=false, PixelFormat desiredFormat=PF_UNKNOWN, bool hwGammaCorrection=false)
Prepares to loads a texture from a file.
virtual ushort getPreferredIntegerBitDepth(void) const
Gets preferred bit depth for integer pixel format textures.
virtual bool isFormatSupported(TextureType ttype, PixelFormat format, int usage)
Returns whether this render system can natively support the precise texture format requested with the...
virtual void setPreferredFloatBitDepth(ushort bits, bool reloadTextures=true)
Sets preferred bit depth for float pixel format textures.
static TextureManager & getSingleton(void)
Override standard Singleton retrieval.
TexturePtr createManual(const String &name, const String &group, TextureType texType, uint width, uint height, int numMipmaps, PixelFormat format, int usage=TU_DEFAULT, ManualResourceLoader *loader=0, bool hwGammaCorrection=false, uint fsaa=0, const String &fsaaHint=StringUtil::BLANK)
Create a manual texture with a depth of 1 (not loaded from a file).
virtual void setPreferredIntegerBitDepth(ushort bits, bool reloadTextures=true)
Sets preferred bit depth for integer pixel format textures.
virtual TexturePtr loadImage(const String &name, const String &group, const Image &img, TextureType texType=TEX_TYPE_2D, int numMipmaps=MIP_DEFAULT, Real gamma=1.0f, bool isAlpha=false, PixelFormat desiredFormat=PF_UNKNOWN, bool hwGammaCorrection=false)
Loads a texture from an Image object.
virtual void setDefaultNumMipmaps(size_t num)
Sets the default number of mipmaps to be used for loaded textures, for when textures are loaded autom...
virtual bool isEquivalentFormatSupported(TextureType ttype, PixelFormat format, int usage)
Returns whether this render system can support the texture format requested with the given usage opti...
virtual PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage)=0
Gets the format which will be natively used for a requested format given the constraints of the curre...
TexturePtr create(const String &name, const String &group, bool isManual=false, ManualResourceLoader *loader=0, const NameValuePairList *createParams=0)
Create a new texture.
virtual void setPreferredBitDepths(ushort integerBits, ushort floatBits, bool reloadTextures=true)
Sets preferred bit depth for integer and float pixel format.
TexturePtr getByName(const String &name, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
Get a resource by name.
ushort mPreferredIntegerBitDepth
PixelFormat
The pixel format used for images, textures, and render surfaces.
TextureType
Enum identifying the texture type.