28 #ifndef _TextureManager_H__
29 #define _TextureManager_H__
103 const String &name,
const String& group,
bool isManual =
false,
106 Real gamma = 1.0f,
bool isAlpha =
false,
139 Real gamma = 1.0f,
bool isAlpha =
false,
174 Real gamma = 1.0f,
bool isAlpha =
false,
176 bool hwGammaCorrection =
false);
251 int numMipmaps =
MIP_DEFAULT,
Real gamma = 1.0f,
bool hwGammaCorrection =
false);
353 return createManual(name, group, texType, width, height, 1,
354 numMipmaps, format, usage, loader, hwGammaCorrection, fsaa, fsaaHint);
463 bool preciseFormatOnly =
false) = 0;
479 return mDefaultNumMipmaps;
Class representing an image file.
Interface describing a manual resource loader.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
Defines a generic resource handler.
std::pair< ResourcePtr, bool > ResourceCreateOrRetrieveResult
Template class for creating single-instance global classes.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
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.
static TextureManager * getSingletonPtr(void)
Override standard Singleton retrieval.
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.
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.
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...
static TextureManager & getSingleton(void)
Override standard Singleton retrieval.
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
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
PixelFormat
The pixel format used for images, textures, and render surfaces.
@ PF_UNKNOWN
Unknown pixel format.
TextureType
Enum identifying the texture type.
@ MIP_DEFAULT
Use TextureManager default.
@ TEX_TYPE_2D
2D texture, used in combination with 2D texture coordinates (default)
@ TU_DEFAULT
Default to automatic mipmap generation static textures.
float Real
Software floating point type.