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

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.