40 #ifndef _graphicstexturemanager_cpp
41 #define _graphicstexturemanager_cpp
43 #include "Graphics/texturemanager.h"
44 #include "Graphics/texture.h"
50 template<> Graphics::TextureManager* Singleton<Graphics::TextureManager>::SingletonPtr = NULL;
74 if( TextureIt == this->
Textures.end() ) {
75 this->
Textures.insert( std::pair<String,Texture*>(TextureName,ToAdd) );
87 return this->
_WrapInternalTexture( this->
_GetInternalManager()->createManual(ResourceName,ResourceGroup,static_cast<Ogre::TextureType>(Type),Width,Height,NumMipMaps,static_cast<Ogre::PixelFormat>(Format),Usage,NULL,HWGammaCorrect,FSAA) );
93 return this->
_WrapInternalTexture( this->
_GetInternalManager()->createManual(ResourceName,ResourceGroup,static_cast<Ogre::TextureType>(Type),Width,Height,Depth,NumMipMaps,static_cast<Ogre::PixelFormat>(Format),Usage,NULL,HWGammaCorrect,FSAA) );
102 if( TexIt != this->
Textures.end() ) {
103 return (*TexIt).second;
111 if( TexIt == this->
Textures.end() ) {
115 delete (*TexIt).second;
122 if( TexIt != this->
Textures.end() ) {
123 return (*TexIt).second;
136 {
delete (*TexIt).second; }
175 {
return Ogre::TextureManager::getSingletonPtr(); }
209 {
delete ToBeDestroyed; }
Texture * CreateManualTexture(const String &ResourceName, const String &ResourceGroup, const Graphics::TextureType Type, const Whole Width, const Whole Height, const Integer NumMipMaps, const Graphics::PixelFormat Format, const Whole Usage=Graphics::TU_Default, const Boole HWGammaCorrect=false, const Whole FSAA=0)
Creates a blank texture with a width and height.
Thrown when duplicates of teh same identity string exist.
TextureType
An enum used to describe the various types of supported textures.
EntresolManager * CreateManager(const NameValuePairList &Params)
Creates a manager of the type represented by this factory.
virtual ManagerType GetInterfaceType() const
This returns the type of this manager.
virtual String GetImplementationTypeName() const
This Allows any manager name to be sent to a stream. Primarily used for logging.
bool Boole
Generally acts a single bit, true or false.
virtual Whole GetNumTextures()
Gets the number of currently loaded Textures.
ManagerType
A listing of Manager Types.
const String & GetName() const
Gets the Name of this Texture.
TextureContainer Textures
Container storing all of the currently loaded Textures.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
int Integer
A datatype used to represent any integer close to.
virtual void UnloadTexture(const String &TextureName)
Unloads a Texture file.
ManagerBase::ManagerType GetManagerType() const
Gets the type of manager that is created by this factory.
TextureContainer::iterator TextureIterator
Iterator type for Texture instances stored in this class.
virtual Texture * LoadTexture(const String &TextureName, const String &Group)
Loads a Texture file from disk and prepares it for use.
static const String ImplementationName
A String containing the name of this manager implementation.
int Usage(Mezzanine::String ThisName, CoreTestGroup &TestGroups)
Print a message for the user onf the standard output that briefly describes hwo to use this...
static Boole SingletonValid()
Checks to see if the singleton pointer is valid.
static TextureManager * GetSingletonPtr()
Fetches a pointer to the singleton.
This is the base class for all managers that do no describe properties of a single world...
virtual ~TextureManager()
Class destructor.
A light-weight handle for manipulating nodes in DOM tree.
ProcessDepth Depth
The current process depth as interpretted by Main.
This class represents a texture loaded into video memory.
PixelFormat
This is used to describe how bits are arraged for each pixel in an image.
virtual void AddTexture(Texture *ToAdd)
Adds a Texture to this manager. the name of the Texture being added is not unique a II_DUPLICATE_IDEN...
Texture * GetTexture(const String &TextureName)
Gets a Texture stored in this manager.
TextureManager()
Class constructor.
String GetManagerImplName() const
Gets the name of the manager that is created by this factory.
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
virtual Texture * _WrapInternalTexture(Ogre::TexturePtr ToWrap)
Wraps and stores an Ogre Texture instance.
Ogre::TextureManager * _GetInternalManager() const
Gets the internal TextureManager.
virtual void UnloadAllTextures()
Unloads every Texture that is currently loaded.
virtual void Deinitialize()
Removes this manager from any necessary configuration so it can be safely disposed of...
static const ManagerBase::ManagerType InterfaceType
A ManagerType enum value used to describe the type of interface/functionality this manager provides...
The bulk of the engine components go in this namspace.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
virtual ~DefaultTextureManagerFactory()
Class destructor.
void DestroyManager(EntresolManager *ToBeDestroyed)
Destroys a Manager created by this factory.
DefaultTextureManagerFactory()
Class constructor.
This manager handles the storage and query of of Graphics Textures.
virtual void Initialize()
Configures this manager for use prior to entering the main loop.
std::string String
A datatype used to a series of characters.
Boole Initialized
Simple Boole indicating whether or not this manager has been initialized.