Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

SynchedTextureManager Class Reference

Inheritance diagram for SynchedTextureManager:

Inheritance graph
[legend]
List of all members.

Detailed Description

ensures that textures are loaded in the main thread

Textures requested from a thread other than the main thread are stored in the requested field. The calling thread then blocks until the SynchedTextureManager function was called from the main thread.

Author:
Daniel Seibert


Public Member Functions

void clear ()
TextureRef get (const TextureInfo &k)
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)
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)
TextureRef get (const std::string &file, const G3D::TextureFormat *, Texture::WrapMode, Texture::InterpolateMode, Texture::Dimension=Texture::DIM_2D, Texture::DepthReadMode=Texture::DEPTH_NORMAL)
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)
Sto get (const Key &k)
unsigned int getCount () const
bool isCached (const TextureInfo &k) const
bool isCached (const Key &k) const
void loadRequested ()
 loads a texture if a request is pending
void remove (const TextureInfo &k)
void remove (const Key &k)
 SynchedTextureManager ()
 ~SynchedTextureManager ()

Protected Member Functions

virtual TextureRef create (const TextureInfo &)=0
virtual Sto create (const Key &)=0
ONE::render::TextureRef create (const ONE::render::TextureInfo &)
 creates a texture in the main thread
void dispose (TextureRef &)
virtual void dispose (Sto &)=0
virtual std::string toString (const TextureInfo &) const =0
std::string toString (const TextureInfo &) const
virtual std::string toString (const Key &) const =0


Constructor & Destructor Documentation

SynchedTextureManager::SynchedTextureManager  ) 
 

SynchedTextureManager::~SynchedTextureManager  ) 
 


Member Function Documentation

virtual TextureRef ONE::util::ResourceManager< Texture , TextureInfo , TextureRef >::create const TextureInfo &   )  [protected, pure virtual, inherited]
 

ONE::render::TextureRef SynchedTextureManager::create const ONE::render::TextureInfo  )  [protected]
 

creates a texture in the main thread

If called from the main thread, this function invokes the original TextureManager 's behavior. If called from a different thread, this function blocks until the texture is created by calling loadRequested from the main thread.

Reimplemented from ONE::render::TextureManager.

TextureRef ONE::util::ResourceManager< Texture , TextureInfo , TextureRef >::get const TextureInfo &  k  )  [inherited]
 

bool ONE::util::ResourceManager< Texture , TextureInfo , TextureRef >::isCached const TextureInfo &  k  )  const [inherited]
 

void SynchedTextureManager::loadRequested  ) 
 

loads a texture if a request is pending

Note:
This function must not be called from a thread other than the main thread.
Exceptions:
EngineException if this function is invoked from any thread other than the main one.

void ONE::util::ResourceManager< Texture , TextureInfo , TextureRef >::remove const TextureInfo &  k  )  [inherited]
 

virtual std::string ONE::util::ResourceManager< Texture , TextureInfo , TextureRef >::toString const TextureInfo &   )  const [protected, pure virtual, inherited]
 


Generated on Wed Sep 7 19:03:46 2005 for AnimalRace by  doxygen 1.4.3