136 virtual float getGamma(
void)
const {
return mGamma; }
302 return mDesiredFormat;
@ HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE
Combination of HBU_DYNAMIC, HBU_WRITE_ONLY and HBU_DISCARDABLE.
@ HBU_WRITE_ONLY
Indicates the application will never read the contents of the buffer back, it will only ever write da...
@ HBU_STATIC_WRITE_ONLY
Combination of HBU_STATIC and HBU_WRITE_ONLY.
@ HBU_STATIC
Static buffer which the application rarely modifies once created.
@ HBU_DYNAMIC_WRITE_ONLY
Combination of HBU_DYNAMIC and HBU_WRITE_ONLY.
@ HBU_DYNAMIC
Indicates the application would like to modify this buffer with the CPU fairly often.
Shared pointer implementation used to share pixel buffers.
Class representing an image file.
Interface describing a manual resource loader.
Defines a generic resource handler.
Abstract class representing a loadable resource (e.g.
Reference-counted shared pointer, used for objects where implicit destruction is required.
Abstract class representing a Texture resource.
virtual void copyToTexture(TexturePtr &target)
Copies (and maybe scales to fit) the contents of this texture to another texture.
virtual void setUsage(int u)
Sets the TextureUsage identifier for this Texture; only useful before load()
virtual PixelFormat getSrcFormat(void) const
Returns the pixel format of the original input texture (may differ due to hardware requirements and p...
virtual void _loadImages(const ConstImagePtrList &images)
Internal method to load the texture from a set of images.
virtual PixelFormat getFormat() const
Returns the pixel format for the texture surface.
unsigned short mDesiredIntegerBitDepth
virtual void loadRawData(DataStreamPtr &stream, ushort uWidth, ushort uHeight, PixelFormat eFormat)
Loads the data from a raw stream.
size_t calculateSize(void) const
Calculate the size of a resource; this will only be called after 'load'.
PixelFormat mSrcFormat
Bit field, so this can't be TextureUsage.
Texture(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
virtual void setDesiredIntegerBitDepth(ushort bits)
Sets desired bit depth for integer pixel format textures.
uint8 mNumRequestedMipmaps
virtual void setNumMipmaps(uint8 num)
Sets the number of mipmaps to be used for this texture.
virtual void setGamma(float g)
Sets the gamma adjustment factor applied to this texture on loading the data.
virtual void setHardwareGammaEnabled(bool enabled)
Sets whether this texture will be set up so that on sampling it, hardware gamma correction is applied...
virtual void freeInternalResources(void)
Frees internal texture resources for this texture.
PixelFormat mDesiredFormat
void unloadImpl(void)
Default implementation of unload which calls freeInternalResources.
virtual bool isHardwareGammaEnabled() const
Gets whether this texture will be set up so that on sampling it, hardware gamma correction is applied...
virtual bool hasAlpha(void) const
Returns true if the texture has an alpha layer.
virtual HardwarePixelBufferSharedPtr getBuffer(size_t face=0, size_t mipmap=0)=0
Return hardware pixel buffer for a surface.
virtual const String & getFSAAHint() const
Get the multisample AA hint if this texture is a rendertarget.
virtual void setHeight(uint32 h)
Set the height of the texture; can only do this before load();.
virtual int getUsage() const
Returns the TextureUsage identifier for this Texture.
virtual void setWidth(uint32 w)
Set the width of the texture; can only do this before load();.
bool mMipmapsHardwareGenerated
virtual bool getMipmapsHardwareGenerated(void) const
Are mipmaps hardware generated?
virtual void freeInternalResourcesImpl(void)=0
Implementation of freeing internal texture resources.
virtual ushort getDesiredIntegerBitDepth(void) const
gets desired bit depth for integer pixel format textures.
virtual void setDepth(uint32 d)
Set the depth of the texture (only applicable for 3D textures); can only do this before load();.
virtual void createInternalResources(void)
Creates the internal texture resources for this texture.
virtual bool getTreatLuminanceAsAlpha(void) const
Gets whether luminace pixel format will treated as alpha format when load this texture.
virtual void setTextureType(TextureType ttype)
Sets the type of texture; can only be changed before load()
virtual uint32 getDepth(void) const
Returns the depth of the texture (only applicable for 3D textures).
unsigned short mDesiredFloatBitDepth
virtual void setDesiredFloatBitDepth(ushort bits)
Sets desired bit depth for float pixel format textures.
virtual void setTreatLuminanceAsAlpha(bool asAlpha)
Sets whether luminace pixel format will treated as alpha format when load this texture.
virtual ushort getDesiredFloatBitDepth(void) const
gets desired bit depth for float pixel format textures.
bool mTreatLuminanceAsAlpha
virtual uint32 getSrcWidth(void) const
Returns the width of the original input texture (may differ due to hardware requirements).
virtual uint32 getSrcHeight(void) const
Returns the height of the original input texture (may differ due to hardware requirements).
virtual void setFSAA(uint fsaa, const String &fsaaHint)
Set the level of multisample AA to be used if this texture is a rendertarget.
virtual size_t getNumFaces() const
Return the number of faces this texture has.
virtual uint8 getNumMipmaps(void) const
Gets the number of mipmaps to be used for this texture.
virtual void loadImage(const Image &img)
Loads the data from an image.
virtual uint32 getWidth(void) const
Returns the width of the texture.
virtual void getCustomAttribute(const String &name, void *pData)
Retrieve a platform or API-specific piece of information from this texture.
virtual PixelFormat getDesiredFormat(void) const
Returns the desired pixel format for the texture surface.
virtual void convertToImage(Image &destImage, bool includeMipMaps=false)
Populate an Image with the contents of this texture.
virtual TextureType getTextureType(void) const
Gets the type of texture.
String getSourceFileType() const
Identify the source file type as a string, either from the extension or from a magic number.
virtual uint32 getHeight(void) const
Returns the height of the texture.
virtual float getGamma(void) const
Returns the gamma adjustment factor applied to this texture on loading.
bool mInternalResourcesCreated
virtual void setDesiredBitDepths(ushort integerBits, ushort floatBits)
Sets desired bit depth for integer and float pixel format.
virtual void createInternalResourcesImpl(void)=0
Implementation of creating internal texture resources.
virtual uint32 getSrcDepth(void) const
Returns the original depth of the input texture (only applicable for 3D textures).
virtual void setFormat(PixelFormat pf)
Sets the pixel format for the texture surface; can only be set before load().
virtual uint getFSAA() const
Get the level of multisample AA to be used if this texture is a rendertarget.
vector< constImage * >::type ConstImagePtrList
PixelFormat
The pixel format used for images, textures, and render surfaces.
TextureMipmap
Enum identifying special mipmap numbers.
TextureType
Enum identifying the texture type.
TextureUsage
Enum identifying the texture usage.
@ MIP_DEFAULT
Use TextureManager default.
@ MIP_UNLIMITED
Generate mipmaps up to 1x1.
@ TEX_TYPE_2D_ARRAY
2D texture array
@ TEX_TYPE_1D
1D texture, used in combination with 1D texture coordinates
@ TEX_TYPE_2D_RECT
2D non-square texture, used in combination with 2D texture coordinates
@ TEX_TYPE_3D
3D volume texture, used in combination with 3D texture coordinates
@ TEX_TYPE_CUBE_MAP
3D cube map, used in combination with 3D texture coordinates
@ TEX_TYPE_2D
2D texture, used in combination with 2D texture coordinates (default)
@ TU_STATIC
Enums describing buffer usage; not mutually exclusive.
@ TU_DYNAMIC_WRITE_ONLY_DISCARDABLE
@ TU_AUTOMIPMAP
Mipmaps will be automatically generated for this texture.
@ TU_DEFAULT
Default to automatic mipmap generation static textures.
@ TU_RENDERTARGET
This texture will be a render target, i.e.