Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::Graphics::TextureManager Class Reference

This manager handles the storage and query of of Graphics Textures. More...

#include <texturemanager.h>

+ Inheritance diagram for Mezzanine::Graphics::TextureManager:
+ Collaboration diagram for Mezzanine::Graphics::TextureManager:

Public Types

typedef TextureContainer::const_iterator ConstTextureIterator
 Const Iterator type for Texture instances stored in this class.
 
typedef std::map< String, Texture * > TextureContainer
 Basic container type for Texture storage in this class.
 
typedef TextureContainer::iterator TextureIterator
 Iterator type for Texture instances stored in this class.
 
- Public Types inherited from Mezzanine::ManagerBase
enum  ManagerType {
  MT_Undefined = 0, MT_AudioManager = 1, MT_AnimationManager = 2, MT_CollisionShapeManager = 3,
  MT_CompositorManager = 4, MT_GraphicsManager = 5, MT_EventManager = 6, MT_InputManager = 7,
  MT_LogManager = 8, MT_MaterialManager = 9, MT_MeshManager = 10, MT_NetworkManager = 11,
  MT_ResourceManager = 12, MT_ScriptingManager = 13, MT_TextureManager = 14, MT_UIManager = 15,
  MT_ActorManager = 101, MT_AreaEffectManager = 102, MT_DebrisManager = 103, MT_PagingManager = 104,
  MT_PhysicsManager = 105, MT_SceneManager = 106, MT_SoundScapeManager = 107, MT_TerrainManager = 108,
  MT_VehicleManager = 109, MT_UserCreated = 512
}
 A listing of Manager Types. More...
 

Public Member Functions

 TextureManager ()
 Class constructor.
 
 TextureManager (const XML::Node &XMLNode)
 XML constructor. More...
 
virtual ~TextureManager ()
 Class destructor.
 
Ogre::TextureManager * _GetInternalManager () const
 Gets the internal TextureManager. More...
 
virtual Texture_WrapInternalTexture (Ogre::TexturePtr ToWrap)
 Wraps and stores an Ogre Texture instance. More...
 
TextureCreateManualTexture (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. More...
 
TextureCreateManualTexture (const String &ResourceName, const String &ResourceGroup, const Graphics::TextureType Type, const Whole Width, const Whole Height, const Whole Depth, 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, height, and depth. More...
 
virtual void Deinitialize ()
 Removes this manager from any necessary configuration so it can be safely disposed of. More...
 
virtual String GetImplementationTypeName () const
 This Allows any manager name to be sent to a stream. Primarily used for logging. More...
 
virtual ManagerType GetInterfaceType () const
 This returns the type of this manager. More...
 
virtual Whole GetNumTextures ()
 Gets the number of currently loaded Textures. More...
 
TextureGetTexture (const String &TextureName)
 Gets a Texture stored in this manager. More...
 
virtual void Initialize ()
 Configures this manager for use prior to entering the main loop. More...
 
virtual TextureLoadTexture (const String &TextureName, const String &Group)
 Loads a Texture file from disk and prepares it for use. More...
 
virtual void UnloadAllTextures ()
 Unloads every Texture that is currently loaded.
 
virtual void UnloadTexture (const String &TextureName)
 Unloads a Texture file. More...
 
- Public Member Functions inherited from Mezzanine::EntresolManager
 EntresolManager ()
 Class constructor.
 
virtual ~EntresolManager ()
 Class destructor.
 
- Public Member Functions inherited from Mezzanine::ManagerBase
 ManagerBase ()
 Class constructor.
 
virtual ~ManagerBase ()
 Class destructor.
 
virtual String GetInterfaceTypeAsString () const
 Gets a string of the interface type of this manager. More...
 
Boole IsInitialized () const
 Gets whether or not this manager has been initialized. More...
 
- Public Member Functions inherited from Mezzanine::Singleton< TextureManager >
 ~Singleton ()
 Class destructor.
 

Static Public Attributes

static const String ImplementationName = "DefaultTextureManager"
 A String containing the name of this manager implementation.
 
static const ManagerBase::ManagerType InterfaceType = ManagerBase::MT_TextureManager
 A ManagerType enum value used to describe the type of interface/functionality this manager provides.
 

Protected Member Functions

virtual void AddTexture (Texture *ToAdd)
 Adds a Texture to this manager.

Exceptions
Ifthe name of the Texture being added is not unique a II_DUPLICATE_IDENTITY_EXCEPTION will be thrown.
More...
 
- Protected Member Functions inherited from Mezzanine::Singleton< TextureManager >
 Singleton ()
 Class constructor.
 

Protected Attributes

TextureContainer Textures
 Container storing all of the currently loaded Textures. More...
 
- Protected Attributes inherited from Mezzanine::ManagerBase
Boole Initialized
 Simple Boole indicating whether or not this manager has been initialized. More...
 
EntresolTheEntresol
 The actual pointer to the Entresol core class. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Mezzanine::ManagerBase
static String GetTypeAsString (const ManagerType &ManagerType)
 Gets the string form of the type of manager. More...
 
static ManagerType GetTypeFromString (const String &ManagerName)
 Gets the type of manager requested from a string. More...
 
- Static Public Member Functions inherited from Mezzanine::Singleton< TextureManager >
static TextureManager * GetSingletonPtr ()
 Fetches a pointer to the singleton. More...
 
static Boole SingletonValid ()
 Checks to see if the singleton pointer is valid. More...
 
- Static Protected Attributes inherited from Mezzanine::Singleton< TextureManager >
static TextureManager * SingletonPtr
 The one and only pointer to the single object. More...
 

Detailed Description

This manager handles the storage and query of of Graphics Textures.

Definition at line 71 of file texturemanager.h.

Constructor & Destructor Documentation

Mezzanine::Graphics::TextureManager::TextureManager ( const XML::Node XMLNode)

XML constructor.

Parameters
XMLNodeThe node of the xml document to construct from.
Todo:
This class currently doesn't initialize anything from XML, if that changes this constructor needs to be expanded.

Definition at line 60 of file texturemanager.cpp.

Member Function Documentation

Ogre::TextureManager * Mezzanine::Graphics::TextureManager::_GetInternalManager ( ) const

Gets the internal TextureManager.

Returns
Returns a pointer to the internal TextureManager.

Definition at line 174 of file texturemanager.cpp.

Texture * Mezzanine::Graphics::TextureManager::_WrapInternalTexture ( Ogre::TexturePtr  ToWrap)
virtual

Wraps and stores an Ogre Texture instance.

Parameters
ToWrapThe Ogre Texture to get wrapped.
Returns
Returns a pointer to the wrapped Texture.

Definition at line 167 of file texturemanager.cpp.

void Mezzanine::Graphics::TextureManager::AddTexture ( Texture ToAdd)
protectedvirtual

Adds a Texture to this manager.

Exceptions
Ifthe name of the Texture being added is not unique a II_DUPLICATE_IDENTITY_EXCEPTION will be thrown.

Parameters
ToAddThe Texture to be added.

Definition at line 70 of file texturemanager.cpp.

Texture * Mezzanine::Graphics::TextureManager::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.

Parameters
ResourceNameThe name of the resource to be created.
ResourceGroupThe name of the group the resource will be created in.
TypeThe type of blank texture to be created. See TextureType enum for more details.
WidthThe width of the texture to be loaded.
HeightThe height of the texture to be loaded.
NumMipMapsThe number of mipmaps that exist for the texture.
FormatThe pixel format to create the buffer for.
UsageIndicates how the texture will be used so the buffer structure can be optimized.
HWGammaCorrectWhether or not to enable hardware gamma correction (sRGB) on this texture. The hardware will convert from gamma space to linear space when reading from this texture. Only applicable for 8-bits per channel textures, will be ignored for other types.
FSAAThe level of multisampling to use if this is a render target. Ignored if usage does not include TU_RenderTarget or if the device does not support it.
Returns
Returns a pointer to the created texture.

Definition at line 84 of file texturemanager.cpp.

Texture * Mezzanine::Graphics::TextureManager::CreateManualTexture ( const String ResourceName,
const String ResourceGroup,
const Graphics::TextureType  Type,
const Whole  Width,
const Whole  Height,
const Whole  Depth,
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, height, and depth.

Parameters
ResourceNameThe name of the resource to be created.
ResourceGroupThe name of the group the resource will be created in.
TypeThe type of blank texture to be created. See TextureType enum for more details.
WidthThe width of the texture to be loaded.
HeightThe height of the texture to be loaded.
NumMipMapsThe number of mipmaps that exist for the texture.
FormatThe pixel format to create the buffer for.
UsageIndicates how the texture will be used so the buffer structure can be optimized.
HWGammaCorrectWhether or not to enable hardware gamma correction (sRGB) on this texture. The hardware will convert from gamma space to linear space when reading from this texture. Only applicable for 8-bits per channel textures, will be ignored for other types.
FSAAThe level of multisampling to use if this is a render target. Ignored if usage does not include TU_RenderTarget or if the device does not support it.
Returns
Returns a pointer to the created texture.

Definition at line 90 of file texturemanager.cpp.

void Mezzanine::Graphics::TextureManager::Deinitialize ( )
virtual

Removes this manager from any necessary configuration so it can be safely disposed of.

Implements Mezzanine::ManagerBase.

Definition at line 147 of file texturemanager.cpp.

String Mezzanine::Graphics::TextureManager::GetImplementationTypeName ( ) const
virtual

This Allows any manager name to be sent to a stream. Primarily used for logging.

Returns
This returns a String that contains the name.

Implements Mezzanine::ManagerBase.

Definition at line 161 of file texturemanager.cpp.

ManagerBase::ManagerType Mezzanine::Graphics::TextureManager::GetInterfaceType ( ) const
virtual

This returns the type of this manager.

This is intended to make using and casting from Manager base easier. With this is is possible to cast from ManagerBase to the correct Manager Type.

Returns
This returns a ManagerTypeName to identify what this can be safely cast to.

Implements Mezzanine::ManagerBase.

Definition at line 158 of file texturemanager.cpp.

Whole Mezzanine::Graphics::TextureManager::GetNumTextures ( )
virtual

Gets the number of currently loaded Textures.

Returns
Returns a Whole representing the number of Textures currently loaded.

Definition at line 128 of file texturemanager.cpp.

Texture * Mezzanine::Graphics::TextureManager::GetTexture ( const String TextureName)

Gets a Texture stored in this manager.

Parameters
MeshNameThe name of the Texture to retrieve.
Returns
Returns a pointer to the requested Texture.

Definition at line 119 of file texturemanager.cpp.

void Mezzanine::Graphics::TextureManager::Initialize ( )
virtual

Configures this manager for use prior to entering the main loop.

Implements Mezzanine::ManagerBase.

Definition at line 144 of file texturemanager.cpp.

Texture * Mezzanine::Graphics::TextureManager::LoadTexture ( const String TextureName,
const String Group 
)
virtual

Loads a Texture file from disk and prepares it for use.

Parameters
TextureNameThe name of the Texture file to be loaded.
GroupThe resource group from which the Texture file should be loaded.
Returns
Returns a pointer to the loaded Texture.

Definition at line 99 of file texturemanager.cpp.

void Mezzanine::Graphics::TextureManager::UnloadTexture ( const String TextureName)
virtual

Unloads a Texture file.

Parameters
MeshNameThe name of the Texture to be unloaded.

Definition at line 108 of file texturemanager.cpp.

Member Data Documentation

TextureContainer Mezzanine::Graphics::TextureManager::Textures
protected

Container storing all of the currently loaded Textures.

Definition at line 88 of file texturemanager.h.


The documentation for this class was generated from the following files: