All used textures should be acquired through this class in order to minimize memory usage.
Note that the texture sources passed to the various get functions are not used to identify the textures. Thus, a call to get may return a cached texture that was created through a different method than the one implied by the source parameters.
|
Public Member Functions |
| void | clear () |
| | clears the cache
|
| Sto | get (const Key &k) |
| | retrieves the object identified by k
|
| TextureRef | get (std::string files[6], const G3D::TextureFormat *frm=G3D::TextureFormat::AUTO, Texture::WrapMode wrp=Texture::CLAMP, Texture::InterpolateMode intr=Texture::TRILINEAR_MIPMAP, Texture::DepthReadMode dep=Texture::DEPTH_NORMAL) |
| | retrieves or creates the cube map with the given attributes
|
| TextureRef | get (const std::string &file, const G3D::TextureFormat *, Texture::WrapMode, Texture::InterpolateMode, Texture::Dimension=Texture::DIM_2D, Texture::DepthReadMode=Texture::DEPTH_NORMAL) |
| | retrieves or creates the texture with the given attributes
|
| TextureRef | get (const int &w, const int &h, const std::string &name, const G3D::TextureFormat *, Texture::WrapMode, Texture::InterpolateMode, Texture::Dimension=Texture::DIM_2D, Texture::DepthReadMode=Texture::DEPTH_NORMAL) |
| | retrieves or creates the texture with the given attributes
|
| TextureRef | get (Image *src, const std::string &name, const G3D::TextureFormat *, Texture::WrapMode, Texture::InterpolateMode, Texture::Dimension=Texture::DIM_2D, Texture::DepthReadMode=Texture::DEPTH_NORMAL) |
| | retrieves or creates the texture with the given attributes
|
| unsigned int | getCount () const |
| bool | isCached (const Key &k) const |
| | checks if the object identified by k is cached
|
| void | remove (const Key &k) |
| | removes an object from the cache
|
| | TextureManager () |
| | ~TextureManager () |
Protected Member Functions |
| virtual Sto | create (const Key &)=0 |
| TextureRef | create (const TextureInfo &) |
| virtual void | dispose (Sto &)=0 |
| void | dispose (TextureRef &) |
| virtual std::string | toString (const Key &) const =0 |
| | converts the given key to an identifier string
|
| std::string | toString (const TextureInfo &) const |