#include <OgreTexture.h>
Inheritance diagram for Ogre::Texture:
Public Types | |
enum | LoadingState { LOADSTATE_UNLOADED, LOADSTATE_LOADING, LOADSTATE_LOADED, LOADSTATE_UNLOADING } |
Enum identifying the loading state of the resource. More... | |
Public Member Functions | |
Texture (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0) | |
virtual void | setTextureType (TextureType ttype) |
Sets the type of texture; can only be changed before load(). | |
virtual TextureType | getTextureType (void) const |
Gets the type of texture. | |
virtual size_t | getNumMipmaps (void) const |
Gets the number of mipmaps to be used for this texture. | |
virtual void | setNumMipmaps (size_t num) |
Sets the number of mipmaps to be used for this texture. | |
virtual bool | getMipmapsHardwareGenerated (void) const |
Are mipmaps hardware generated? | |
virtual float | getGamma (void) const |
Returns the gamma adjustment factor applied to this texture. | |
virtual void | setGamma (float g) |
Sets the gamma adjustment factor applied to this texture. | |
virtual size_t | getHeight (void) const |
Returns the height of the texture. | |
virtual size_t | getWidth (void) const |
Returns the width of the texture. | |
virtual size_t | getDepth (void) const |
Returns the depth of the texture (only applicable for 3D textures). | |
virtual size_t | getSrcHeight (void) const |
Returns the height of the original input texture (may differ due to hardware requirements). | |
virtual size_t | getSrcWidth (void) const |
Returns the width of the original input texture (may differ due to hardware requirements). | |
virtual size_t | getSrcDepth (void) const |
Returns the original depth of the input texture (only applicable for 3D textures). | |
virtual void | setHeight (size_t h) |
Set the height of the texture; can only do this before load();. | |
virtual void | setWidth (size_t w) |
Set the width of the texture; can only do this before load();. | |
virtual void | setDepth (size_t d) |
Set the depth of the texture (only applicable for 3D textures); ; can only do this before load();. | |
virtual int | getUsage () const |
Returns the TextureUsage indentifier for this Texture. | |
virtual void | setUsage (int u) |
Sets the TextureUsage indentifier for this Texture; only useful before load(). | |
virtual void | createInternalResources (void) |
Creates the internal texture resources for this texture. | |
virtual void | freeInternalResources (void) |
Frees internal texture resources for this texture. | |
virtual void | copyToTexture (TexturePtr &target) |
Copies (and maybe scales to fit) the contents of this texture to another texture. | |
virtual void | loadImage (const Image &img) |
Loads the data from an image. | |
virtual void | loadRawData (DataStreamPtr &stream, ushort uWidth, ushort uHeight, PixelFormat eFormat) |
Loads the data from a raw stream. | |
virtual void | _loadImages (const ConstImagePtrList &images) |
Internal method to load the texture from a set of images. | |
virtual PixelFormat | getFormat () const |
Returns the pixel format for the texture surface. | |
virtual PixelFormat | getDesiredFormat (void) const |
Returns the desired pixel format for the texture surface. | |
virtual PixelFormat | getSrcFormat (void) const |
Returns the pixel format of the original input texture (may differ due to hardware requirements and pixel format convertion). | |
virtual void | setFormat (PixelFormat pf) |
Sets the pixel format for the texture surface; can only be set before load(). | |
virtual bool | hasAlpha (void) const |
Returns true if the texture has an alpha layer. | |
virtual void | setDesiredIntegerBitDepth (ushort bits) |
Sets desired bit depth for integer pixel format textures. | |
virtual ushort | getDesiredIntegerBitDepth (void) const |
gets desired bit depth for integer pixel format textures. | |
virtual void | setDesiredFloatBitDepth (ushort bits) |
Sets desired bit depth for float pixel format textures. | |
virtual ushort | getDesiredFloatBitDepth (void) const |
gets desired bit depth for float pixel format textures. | |
virtual void | setDesiredBitDepths (ushort integerBits, ushort floatBits) |
Sets desired bit depth for integer and float pixel format. | |
virtual void | setTreatLuminanceAsAlpha (bool asAlpha) |
Sets whether luminace pixel format will treated as alpha format when load this texture. | |
virtual bool | getTreatLuminanceAsAlpha (void) const |
Gets whether luminace pixel format will treated as alpha format when load this texture. | |
virtual size_t | getNumFaces () const |
Return the number of faces this texture has. | |
virtual HardwarePixelBufferSharedPtr | getBuffer (size_t face=0, size_t mipmap=0)=0 |
Return hardware pixel buffer for a surface. | |
virtual void | load (bool backgroundThread=false) |
Loads the resource, if it is not already. | |
virtual void | reload (void) |
Reloads the resource, if it is already loaded. | |
bool | isReloadable (void) const |
Returns true if the Resource is reloadable, false otherwise. | |
bool | isManuallyLoaded (void) const |
Is this resource manually loaded? | |
virtual void | unload (void) |
Unloads the resource; this is not permanent, the resource can be reloaded later if required. | |
size_t | getSize (void) const |
Retrieves info about the size of the resource. | |
virtual void | touch (void) |
'Touches' the resource to indicate it has been used. | |
const String & | getName (void) const |
Gets resource name. | |
ResourceHandle | getHandle (void) const |
bool | isLoaded (void) const |
Returns true if the Resource has been loaded, false otherwise. | |
LoadingState | isLoading () const |
Returns whether the resource is currently in the process of background loading. | |
LoadingState | getLoadingState () const |
Returns the current loading state. | |
bool | isBackgroundLoaded (void) const |
Returns whether this Resource has been earmarked for background loading. | |
void | setBackgroundLoaded (bool bl) |
Tells the resource whether it is background loaded or not. | |
void | escalateLoading () |
Escalates the loading of a background loaded resource. | |
void | addListener (Listener *lis) |
Register a listener on this resource. | |
void | removeListener (Listener *lis) |
Remove a listener on this resource. | |
const String & | getGroup (void) |
Gets the group which this resource is a member of. | |
void | changeGroupOwnership (const String &newGroup) |
Change the resource group ownership of a Resource. | |
ResourceManager * | getCreator (void) |
Gets the manager which created this resource. | |
const String & | getOrigin (void) const |
Get the origin of this resource, e.g. | |
void | _notifyOrigin (const String &origin) |
Notify this resource of it's origin. | |
ParamDictionary * | getParamDictionary (void) |
Retrieves the parameter dictionary for this class. | |
const ParamDictionary * | getParamDictionary (void) const |
const ParameterList & | getParameters (void) const |
Retrieves a list of parameters valid for this object. | |
virtual bool | setParameter (const String &name, const String &value) |
Generic parameter setting method. | |
virtual void | setParameterList (const NameValuePairList ¶mList) |
Generic multiple parameter setting method. | |
virtual String | getParameter (const String &name) const |
Generic parameter retrieval method. | |
virtual void | copyParametersTo (StringInterface *dest) const |
Method for copying this object's parameters to another object. | |
Static Public Member Functions | |
static void | cleanupDictionary () |
Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g. | |
Protected Types | |
typedef std::list< Listener * > | ListenerList |
Protected Member Functions | |
size_t | calculateSize (void) const |
| |
virtual void | createInternalResourcesImpl (void)=0 |
Implementation of creating internal texture resources. | |
virtual void | freeInternalResourcesImpl (void)=0 |
Implementation of freeing internal texture resources. | |
void | unloadImpl (void) |
Default implementation of unload which calls freeInternalResources. | |
virtual void | preLoadImpl (void) |
Internal hook to perform actions before the load process, but after the resource has been marked as 'loading'. | |
virtual void | postLoadImpl (void) |
Internal hook to perform actions after the load process, but before the resource has been marked as fully loaded. | |
virtual void | preUnloadImpl (void) |
Internal hook to perform actions before the unload process. | |
virtual void | postUnloadImpl (void) |
Internal hook to perform actions after the unload process, but before the resource has been marked as fully unloaded. | |
virtual void | loadImpl (void)=0 |
Internal implementation of the meat of the 'load' action, only called if this resource is not being loaded from a ManualResourceLoader. | |
virtual void | queueFireBackgroundLoadingComplete (void) |
Queue the firing of background loading complete event. | |
bool | createParamDictionary (const String &className) |
Internal method for creating a parameter dictionary for the class, if it does not already exist. | |
Protected Attributes | |
size_t | mHeight |
size_t | mWidth |
size_t | mDepth |
size_t | mNumRequestedMipmaps |
size_t | mNumMipmaps |
bool | mMipmapsHardwareGenerated |
float | mGamma |
TextureType | mTextureType |
PixelFormat | mFormat |
int | mUsage |
PixelFormat | mSrcFormat |
size_t | mSrcWidth |
size_t | mSrcHeight |
size_t | mSrcDepth |
PixelFormat | mDesiredFormat |
unsigned short | mDesiredIntegerBitDepth |
unsigned short | mDesiredFloatBitDepth |
bool | mTreatLuminanceAsAlpha |
bool | mInternalResourcesCreated |
ResourceManager * | mCreator |
Creator. | |
String | mName |
Unique name of the resource. | |
String | mGroup |
The name of the resource group. | |
ResourceHandle | mHandle |
Numeric handle for more efficient look up than name. | |
volatile LoadingState | mLoadingState |
Is the resource currently loaded? | |
volatile bool | mIsBackgroundLoaded |
Is this resource going to be background loaded? Only applicable for multithreaded. | |
size_t | mSize |
Mutex to cover the status of loading The size of the resource in bytes. | |
bool | mIsManual |
Is this file manually loaded? | |
String | mOrigin |
Origin of this resource (e.g. script name) - optional. | |
ManualResourceLoader * | mLoader |
Optional manual loader; if provided, data is loaded from here instead of a file. | |
ListenerList | mListenerList |
String | mParamDictName |
Class name for this instance to be used as a lookup (must be initialised by subclasses). | |
Static Protected Attributes | |
static ParamDictionaryMap | msDictionary |
Dictionary of parameters. |
Definition at line 96 of file OgreTexture.h.
|
Definition at line 131 of file OgreResource.h. |
|
Enum identifying the loading state of the resource.
Definition at line 96 of file OgreResource.h. |
|
|
|
Internal method to load the texture from a set of images.
|
|
Notify this resource of it's origin.
Definition at line 357 of file OgreResource.h. |
|
Register a listener on this resource.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. |
|
Implements Ogre::Resource. |
|
Change the resource group ownership of a Resource.
|
|
Cleans up the static 'msDictionary' required to reset Ogre, otherwise the containers are left with invalid pointers, which will lead to a crash as soon as one of the ResourceManager implementers (e.g. MaterialManager) initializes. |
|
Method for copying this object's parameters to another object.
Definition at line 300 of file OgreStringInterface.h. References Ogre::ParamDictionary::mParamDefs. |
|
Copies (and maybe scales to fit) the contents of this texture to another texture.
|
|
Creates the internal texture resources for this texture.
|
|
Implementation of creating internal texture resources.
|
|
Internal method for creating a parameter dictionary for the class, if it does not already exist.
Definition at line 176 of file OgreStringInterface.h. |
|
Escalates the loading of a background loaded resource.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. |
|
Frees internal texture resources for this texture.
|
|
Implementation of freeing internal texture resources.
|
|
Return hardware pixel buffer for a surface. This buffer can then be used to copy data from and to a particular level of the texture.
|
|
Gets the manager which created this resource.
Definition at line 348 of file OgreResource.h. |
|
Returns the depth of the texture (only applicable for 3D textures).
Definition at line 146 of file OgreTexture.h. |
|
gets desired bit depth for float pixel format textures.
|
|
Returns the desired pixel format for the texture surface.
Definition at line 245 of file OgreTexture.h. |
|
gets desired bit depth for integer pixel format textures.
|
|
Returns the pixel format for the texture surface.
Definition at line 239 of file OgreTexture.h. |
|
Returns the gamma adjustment factor applied to this texture.
Definition at line 128 of file OgreTexture.h. |
|
Gets the group which this resource is a member of.
Reimplemented in Ogre::SkeletonInstance. Definition at line 336 of file OgreResource.h. |
|
Reimplemented in Ogre::SkeletonInstance. Definition at line 262 of file OgreResource.h. |
|
Returns the height of the texture.
Definition at line 138 of file OgreTexture.h. |
|
Returns the current loading state.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. Definition at line 285 of file OgreResource.h. |
|
Are mipmaps hardware generated?
Definition at line 124 of file OgreTexture.h. |
|
Gets resource name.
Reimplemented in Ogre::SkeletonInstance. Definition at line 257 of file OgreResource.h. |
|
Return the number of faces this texture has. This will be 6 for a cubemap texture and 1 for a 1D, 2D or 3D one. |
|
Gets the number of mipmaps to be used for this texture.
Definition at line 112 of file OgreTexture.h. |
|
Get the origin of this resource, e.g. a script file name.
Definition at line 355 of file OgreResource.h. |
|
Definition at line 213 of file OgreStringInterface.h. |
|
Retrieves the parameter dictionary for this class.
Definition at line 200 of file OgreStringInterface.h. |
|
Generic parameter retrieval method.
Definition at line 269 of file OgreStringInterface.h. References Ogre::ParamCommand::doGet(), and Ogre::ParamDictionary::getParamCommand(). |
|
Retrieves a list of parameters valid for this object.
|
|
Retrieves info about the size of the resource.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. Definition at line 246 of file OgreResource.h. |
|
Returns the original depth of the input texture (only applicable for 3D textures).
Definition at line 158 of file OgreTexture.h. |
|
Returns the pixel format of the original input texture (may differ due to hardware requirements and pixel format convertion).
Definition at line 253 of file OgreTexture.h. |
|
Returns the height of the original input texture (may differ due to hardware requirements).
Definition at line 150 of file OgreTexture.h. |
|
Returns the width of the original input texture (may differ due to hardware requirements).
Definition at line 154 of file OgreTexture.h. |
|
Gets the type of texture.
Definition at line 108 of file OgreTexture.h. |
|
Gets whether luminace pixel format will treated as alpha format when load this texture.
|
|
Returns the TextureUsage indentifier for this Texture.
Definition at line 175 of file OgreTexture.h. |
|
Returns the width of the texture.
Definition at line 142 of file OgreTexture.h. |
|
Returns true if the texture has an alpha layer.
|
|
Returns whether this Resource has been earmarked for background loading.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. Definition at line 302 of file OgreResource.h. |
|
Returns true if the Resource has been loaded, false otherwise.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. Definition at line 269 of file OgreResource.h. |
|
Returns whether the resource is currently in the process of background loading.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. Definition at line 278 of file OgreResource.h. |
|
Is this resource manually loaded?
Definition at line 234 of file OgreResource.h. |
|
Returns true if the Resource is reloadable, false otherwise.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. Definition at line 227 of file OgreResource.h. |
|
Loads the resource, if it is not already.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. |
|
Loads the data from an image.
|
|
Internal implementation of the meat of the 'load' action, only called if this resource is not being loaded from a ManualResourceLoader.
Implemented in Ogre::Compositor, Ogre::Font, Ogre::GpuProgram, Ogre::HighLevelGpuProgram, Ogre::Material, Ogre::Mesh, Ogre::PatchMesh, Ogre::Skeleton, and Ogre::SkeletonInstance. |
|
Loads the data from a raw stream.
|
|
Internal hook to perform actions after the load process, but before the resource has been marked as fully loaded.
Reimplemented in Ogre::Mesh. Definition at line 155 of file OgreResource.h. |
|
Internal hook to perform actions after the unload process, but before the resource has been marked as fully unloaded.
Definition at line 165 of file OgreResource.h. |
|
Internal hook to perform actions before the load process, but after the resource has been marked as 'loading'.
Definition at line 148 of file OgreResource.h. |
|
Internal hook to perform actions before the unload process.
Definition at line 160 of file OgreResource.h. |
|
Queue the firing of background loading complete event.
|
|
Reloads the resource, if it is already loaded.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. |
|
Remove a listener on this resource.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. |
|
Tells the resource whether it is background loaded or not.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. Definition at line 312 of file OgreResource.h. |
|
Set the depth of the texture (only applicable for 3D textures); ; can only do this before load();.
Definition at line 171 of file OgreTexture.h. |
|
Sets desired bit depth for integer and float pixel format.
|
|
Sets desired bit depth for float pixel format textures.
|
|
Sets desired bit depth for integer pixel format textures.
|
|
Sets the pixel format for the texture surface; can only be set before load().
|
|
Sets the gamma adjustment factor applied to this texture.
Definition at line 134 of file OgreTexture.h. |
|
Set the height of the texture; can only do this before load();.
Definition at line 162 of file OgreTexture.h. |
|
Sets the number of mipmaps to be used for this texture.
Definition at line 118 of file OgreTexture.h. |
|
Generic parameter setting method.
|
|
Generic multiple parameter setting method.
|
|
Sets the type of texture; can only be changed before load().
Definition at line 104 of file OgreTexture.h. |
|
Sets whether luminace pixel format will treated as alpha format when load this texture.
|
|
Sets the TextureUsage indentifier for this Texture; only useful before load().
Definition at line 187 of file OgreTexture.h. |
|
Set the width of the texture; can only do this before load();.
Definition at line 166 of file OgreTexture.h. |
|
'Touches' the resource to indicate it has been used.
Reimplemented in Ogre::Material, and Ogre::UnifiedHighLevelGpuProgram. |
|
Unloads the resource; this is not permanent, the resource can be reloaded later if required.
Reimplemented in Ogre::UnifiedHighLevelGpuProgram. |
|
Default implementation of unload which calls freeInternalResources.
Implements Ogre::Resource. |
|
Creator.
Definition at line 109 of file OgreResource.h. |
|
Definition at line 320 of file OgreTexture.h. |
|
Definition at line 336 of file OgreTexture.h. |
|
Definition at line 334 of file OgreTexture.h. |
|
Definition at line 335 of file OgreTexture.h. |
|
Definition at line 328 of file OgreTexture.h. |
|
Definition at line 325 of file OgreTexture.h. |
|
The name of the resource group.
Definition at line 113 of file OgreResource.h. |
|
Numeric handle for more efficient look up than name.
Definition at line 115 of file OgreResource.h. |
|
Definition at line 318 of file OgreTexture.h. |
|
Definition at line 339 of file OgreTexture.h. |
|
Is this resource going to be background loaded? Only applicable for multithreaded.
Definition at line 119 of file OgreResource.h. |
|
Is this file manually loaded?
Definition at line 125 of file OgreResource.h. |
|
Definition at line 132 of file OgreResource.h. |
|
Optional manual loader; if provided, data is loaded from here instead of a file.
Definition at line 129 of file OgreResource.h. |
|
Is the resource currently loaded?
Definition at line 117 of file OgreResource.h. |
|
Definition at line 324 of file OgreTexture.h. |
|
Unique name of the resource.
Definition at line 111 of file OgreResource.h. |
|
Definition at line 323 of file OgreTexture.h. |
|
Definition at line 322 of file OgreTexture.h. |
|
Origin of this resource (e.g. script name) - optional.
Definition at line 127 of file OgreResource.h. |
|
Class name for this instance to be used as a lookup (must be initialised by subclasses).
Definition at line 164 of file OgreStringInterface.h. |
|
Dictionary of parameters.
Definition at line 161 of file OgreStringInterface.h. |
|
Mutex to cover the status of loading The size of the resource in bytes.
Definition at line 123 of file OgreResource.h. |
|
Definition at line 332 of file OgreTexture.h. |
|
Definition at line 331 of file OgreTexture.h. |
|
Definition at line 332 of file OgreTexture.h. |
|
Definition at line 332 of file OgreTexture.h. |
|
Definition at line 327 of file OgreTexture.h. |
|
Definition at line 337 of file OgreTexture.h. |
|
Definition at line 329 of file OgreTexture.h. |
|
Definition at line 319 of file OgreTexture.h. |
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 8 15:25:24 2007