#include <OgreD3D9Texture.h>
Inheritance diagram for Ogre::D3D9Texture:
Public Member Functions | |||||
D3D9Texture (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual, ManualResourceLoader *loader, IDirect3DDevice9 *pD3DDevice) | |||||
constructor | |||||
~D3D9Texture () | |||||
destructor | |||||
void | copyToTexture (TexturePtr &target) | ||||
overriden from Texture | |||||
void | loadImage (const Image &img) | ||||
overriden from Texture | |||||
HardwarePixelBufferSharedPtr | getBuffer (size_t face, size_t mipmap) | ||||
This buffer can then be used to copy data from and to a particular level of the texture.
| |||||
IDirect3DBaseTexture9 * | getTexture () | ||||
retrieves a pointer to the actual texture | |||||
IDirect3DTexture9 * | getNormTexture () | ||||
retrieves a pointer to the normal 1D/2D texture | |||||
IDirect3DCubeTexture9 * | getCubeTexture () | ||||
retrieves a pointer to the cube texture | |||||
bool | releaseIfDefaultPool (void) | ||||
For dealing with lost devices - release the resource if in the default pool (and return true). | |||||
bool | recreateIfDefaultPool (LPDIRECT3DDEVICE9 pDev) | ||||
For dealing with lost devices - recreate the resource if in the default pool (and return true). | |||||
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 unsigned int | getHeight (void) const | ||||
Returns the height of the texture. | |||||
virtual unsigned int | getWidth (void) const | ||||
Returns the width of the texture. | |||||
virtual unsigned int | getDepth (void) const | ||||
Returns the depth of the texture (only applicable for 3D textures). | |||||
virtual unsigned int | getSrcHeight (void) const | ||||
Returns the height of the original input texture (may differ due to hardware requirements). | |||||
virtual unsigned int | getSrcWidth (void) const | ||||
Returns the width of the original input texture (may differ due to hardware requirements). | |||||
virtual unsigned int | getSrcDepth (void) const | ||||
Returns the original depth of the input texture (only applicable for 3D textures). | |||||
virtual void | setHeight (unsigned int h) | ||||
Set the height of the texture; can only do this before load();. | |||||
virtual void | setWidth (unsigned int w) | ||||
Set the width of the texture; can only do this before load();. | |||||
virtual void | setDepth (unsigned int 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 | loadRawData (DataStreamPtr &stream, ushort uWidth, ushort uHeight, PixelFormat eFormat) | ||||
Loads the data from a raw stream. | |||||
virtual void | enable32Bit (bool setting=true) | ||||
virtual PixelFormat | getFormat () const | ||||
Returns the pixel format for the texture surface. | |||||
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 size_t | getNumFaces () const | ||||
Return the number of faces this texture has. | |||||
virtual void | load (void) | ||||
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. | |||||
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 | |||||
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::vector< HardwarePixelBufferSharedPtr > | SurfaceList | ||||
Vector of pointers to subsurfaces. | |||||
Protected Member Functions | |||||
void | _initDevice (void) | ||||
Initialise the device and get formats. | |||||
void | _loadCubeTex () | ||||
internal method, load a cube texture | |||||
void | _loadNormTex () | ||||
internal method, load a normal texture | |||||
void | _loadVolumeTex () | ||||
internal method, load a volume texture | |||||
void | _createNormTex () | ||||
internal method, create a blank normal 1D/2D texture | |||||
void | _createCubeTex () | ||||
internal method, create a blank cube texture | |||||
void | _createVolumeTex () | ||||
internal method, create a blank cube texture | |||||
D3DFORMAT | _chooseD3DFormat () | ||||
internal method, return a D3D pixel format for texture creation | |||||
void | createInternalResourcesImpl (void) | ||||
| |||||
void | freeInternalResourcesImpl (void) | ||||
free internal resources | |||||
void | _setSrcAttributes (unsigned long width, unsigned long height, unsigned long depth, PixelFormat format) | ||||
internal method, set Texture class source image protected attributes | |||||
void | _setFinalAttributes (unsigned long width, unsigned long height, unsigned long depth, PixelFormat format) | ||||
internal method, set Texture class final texture protected attributes | |||||
D3DTEXTUREFILTERTYPE | _getBestFilterMethod () | ||||
internal method, return the best by hardware supported filter method | |||||
bool | _canUseDynamicTextures (DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat) | ||||
internal method, return true if the device/texture combination can use dynamic textures | |||||
bool | _canAutoGenMipmaps (DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat) | ||||
internal method, return true if the device/texture combination can auto gen. mip maps | |||||
String | _getCubeFaceName (unsigned char face) const | ||||
internal method, the cube map face name for the spec. face index | |||||
void | _createSurfaceList (void) | ||||
internal method, create D3D9HardwarePixelBuffers for every face and mipmap level. | |||||
void | loadImpl () | ||||
overriden from Resource | |||||
size_t | calculateSize (void) const | ||||
| |||||
virtual void | _loadImages (const std::vector< const Image * > &images) | ||||
Generic method to load the texture from a set of images. | |||||
void | unloadImpl (void) | ||||
Default implementation of unload which calls freeInternalResources. | |||||
bool | createParamDictionary (const String &className) | ||||
Internal method for creating a parameter dictionary for the class, if it does not already exist. | |||||
Protected Attributes | |||||
IDirect3DDevice9 * | mpDev | ||||
D3DDevice pointer. | |||||
IDirect3D9 * | mpD3D | ||||
D3D9 pointer. | |||||
IDirect3DTexture9 * | mpNormTex | ||||
1D/2D normal texture pointer | |||||
IDirect3DCubeTexture9 * | mpCubeTex | ||||
cubic texture pointer | |||||
IDirect3DVolumeTexture9 * | mpVolumeTex | ||||
Volume texture. | |||||
IDirect3DBaseTexture9 * | mpTex | ||||
actual texture pointer | |||||
String | mCubeFaceNames [6] | ||||
cube texture individual face names | |||||
D3DDEVICE_CREATION_PARAMETERS | mDevCreParams | ||||
device creation parameters | |||||
D3DFORMAT | mBBPixelFormat | ||||
back buffer pixel format | |||||
D3DPOOL | mD3DPool | ||||
The memory pool being used. | |||||
D3DCAPS9 | mDevCaps | ||||
device capabilities pointer | |||||
bool | mDynamicTextures | ||||
SurfaceList | mSurfaceList | ||||
unsigned long | mHeight | ||||
unsigned long | mWidth | ||||
unsigned long | mDepth | ||||
size_t | mNumRequestedMipmaps | ||||
size_t | mNumMipmaps | ||||
bool | mMipmapsHardwareGenerated | ||||
float | mGamma | ||||
TextureType | mTextureType | ||||
PixelFormat | mFormat | ||||
int | mUsage | ||||
unsigned short | mSrcBpp | ||||
unsigned long | mSrcWidth | ||||
unsigned long | mSrcHeight | ||||
unsigned long | mSrcDepth | ||||
unsigned short | mFinalBpp | ||||
bool | mHasAlpha | ||||
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. | |||||
bool | mIsLoaded | ||||
Is the resource currently loaded? | |||||
size_t | mSize | ||||
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. | |||||
String | mParamDictName | ||||
Class name for this instance to be used as a lookup (must be initialised by subclasses). | |||||
Static Protected Attributes | |||||
ParamDictionaryMap | msDictionary | ||||
Dictionary of parameters. |
|
Vector of pointers to subsurfaces.
Definition at line 71 of file OgreD3D9Texture.h. |
|
constructor
|
|
destructor
|
|
internal method, return true if the device/texture combination can auto gen. mip maps
|
|
internal method, return true if the device/texture combination can use dynamic textures
|
|
internal method, return a D3D pixel format for texture creation
|
|
internal method, create a blank cube texture
|
|
internal method, create a blank normal 1D/2D texture
|
|
internal method, create D3D9HardwarePixelBuffers for every face and mipmap level. This method must be called after the D3D texture object was created |
|
internal method, create a blank cube texture
|
|
internal method, return the best by hardware supported filter method
|
|
internal method, the cube map face name for the spec. face index
Definition at line 109 of file OgreD3D9Texture.h. References mCubeFaceNames, and Ogre::String. |
|
Initialise the device and get formats.
|
|
internal method, load a cube texture
|
|
Generic method to load the texture from a set of images. This can be used by the specific implementation for convience. Implementations might decide not to use this function if they can use their own image loading functions.
|
|
internal method, load a normal texture
|
|
internal method, load a volume texture
|
|
Notify this resource of it's origin.
Definition at line 223 of file OgreResource.h. References Ogre::String. |
|
internal method, set Texture class final texture protected attributes
|
|
internal method, set Texture class source image protected attributes
|
|
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 296 of file OgreStringInterface.h. References Ogre::ParamDictionary::mParamDefs, and Ogre::StringInterface::setParameter(). |
|
overriden from Texture
Reimplemented from Ogre::Texture. |
|
Creates the internal texture resources for this texture.
|
|
Implements Ogre::Texture. |
|
Internal method for creating a parameter dictionary for the class, if it does not already exist.
Definition at line 172 of file OgreStringInterface.h. References Ogre::String. |
|
Definition at line 213 of file OgreTexture.h. |
|
Frees internal texture resources for this texture.
|
|
free internal resources
Implements Ogre::Texture. |
|
This buffer can then be used to copy data from and to a particular level of the texture.
Implements Ogre::Texture. |
|
Gets the manager which created this resource.
Definition at line 214 of file OgreResource.h. |
|
retrieves a pointer to the cube texture
Definition at line 142 of file OgreD3D9Texture.h. References mpCubeTex. |
|
Returns the depth of the texture (only applicable for 3D textures).
Definition at line 140 of file OgreTexture.h. |
|
Returns the pixel format for the texture surface.
Definition at line 219 of file OgreTexture.h. References Ogre::PixelFormat. |
|
Returns the gamma adjustment factor applied to this texture.
Definition at line 122 of file OgreTexture.h. |
|
Gets the group which this resource is a member of.
Definition at line 202 of file OgreResource.h. References Ogre::String. |
|
Definition at line 188 of file OgreResource.h. References Ogre::ResourceHandle. |
|
Returns the height of the texture.
Definition at line 132 of file OgreTexture.h. |
|
Are mipmaps hardware generated?
Definition at line 118 of file OgreTexture.h. |
|
Gets resource name.
Definition at line 183 of file OgreResource.h. References Ogre::String. |
|
retrieves a pointer to the normal 1D/2D texture
Definition at line 139 of file OgreD3D9Texture.h. References mpNormTex. |
|
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 106 of file OgreTexture.h. |
|
Get the origin of this resource, e.g. a script file name.
Definition at line 221 of file OgreResource.h. References Ogre::String. |
|
Definition at line 209 of file OgreStringInterface.h. |
|
Retrieves the parameter dictionary for this class.
Definition at line 196 of file OgreStringInterface.h. |
|
Generic parameter retrieval method.
Definition at line 265 of file OgreStringInterface.h. References Ogre::ParamCommand::doGet(), Ogre::ParamDictionary::getParamCommand(), and Ogre::String. |
|
Retrieves a list of parameters valid for this object.
|
|
Retrieves info about the size of the resource.
Definition at line 172 of file OgreResource.h. |
|
Returns the original depth of the input texture (only applicable for 3D textures).
Definition at line 152 of file OgreTexture.h. |
|
Returns the height of the original input texture (may differ due to hardware requirements).
Definition at line 144 of file OgreTexture.h. |
|
Returns the width of the original input texture (may differ due to hardware requirements).
Definition at line 148 of file OgreTexture.h. |
|
retrieves a pointer to the actual texture
Definition at line 136 of file OgreD3D9Texture.h. References mpTex. |
|
Gets the type of texture.
Definition at line 102 of file OgreTexture.h. References Ogre::TextureType. |
|
Returns the TextureUsage indentifier for this Texture.
Definition at line 169 of file OgreTexture.h. |
|
Returns the width of the texture.
Definition at line 136 of file OgreTexture.h. |
|
Returns true if the texture has an alpha layer.
Definition at line 228 of file OgreTexture.h. |
|
Returns true if the Resource has been loaded, false otherwise.
Definition at line 195 of file OgreResource.h. References OGRE_LOCK_AUTO_MUTEX. |
|
Is this resource manually loaded?
Definition at line 160 of file OgreResource.h. |
|
Returns true if the Resource is reloadable, false otherwise.
Definition at line 153 of file OgreResource.h. |
|
Loads the resource, if it is not already.
Reimplemented in Ogre::Mesh, and Ogre::GLSLGpuProgram. |
|
overriden from Texture
Implements Ogre::Texture. |
|
overriden from Resource
Implements Ogre::Resource. |
|
Loads the data from a raw stream.
|
|
For dealing with lost devices - recreate the resource if in the default pool (and return true).
|
|
For dealing with lost devices - release the resource if in the default pool (and return true).
|
|
Reloads the resource, if it is already loaded.
|
|
Set the depth of the texture (only applicable for 3D textures); ; can only do this before load();.
Definition at line 165 of file OgreTexture.h. |
|
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 128 of file OgreTexture.h. |
|
Set the height of the texture; can only do this before load();.
Definition at line 156 of file OgreTexture.h. |
|
Sets the number of mipmaps to be used for this texture.
Definition at line 112 of file OgreTexture.h. |
|
Generic parameter setting method.
Referenced by Ogre::StringInterface::copyParametersTo(). |
|
Generic multiple parameter setting method.
|
|
Sets the type of texture; can only be changed before load().
Definition at line 98 of file OgreTexture.h. |
|
Sets the TextureUsage indentifier for this Texture; only useful before load().
Definition at line 181 of file OgreTexture.h. |
|
Set the width of the texture; can only do this before load();.
Definition at line 160 of file OgreTexture.h. |
|
'Touches' the resource to indicate it has been used.
Reimplemented in Ogre::Material. |
|
Unloads the resource; this is not permanent, the resource can be reloaded later if required.
Reimplemented in Ogre::GLSLGpuProgram. |
|
Default implementation of unload which calls freeInternalResources.
Implements Ogre::Resource. |
|
back buffer pixel format
Definition at line 63 of file OgreD3D9Texture.h. |
|
Creator.
Definition at line 73 of file OgreResource.h. |
|
cube texture individual face names
Definition at line 59 of file OgreD3D9Texture.h. Referenced by _getCubeFaceName(). |
|
The memory pool being used.
Definition at line 65 of file OgreD3D9Texture.h. |
|
Definition at line 255 of file OgreTexture.h. |
|
device capabilities pointer
Definition at line 67 of file OgreD3D9Texture.h. |
|
device creation parameters
Definition at line 61 of file OgreD3D9Texture.h. |
|
Definition at line 69 of file OgreD3D9Texture.h. |
|
Definition at line 268 of file OgreTexture.h. |
|
Definition at line 263 of file OgreTexture.h. |
|
Definition at line 260 of file OgreTexture.h. |
|
The name of the resource group.
Definition at line 77 of file OgreResource.h. |
|
Numeric handle for more efficient look up than name.
Definition at line 79 of file OgreResource.h. |
|
Definition at line 269 of file OgreTexture.h. |
|
Definition at line 253 of file OgreTexture.h. |
|
Definition at line 271 of file OgreTexture.h. |
|
Is the resource currently loaded?
Definition at line 81 of file OgreResource.h. |
|
Is this file manually loaded?
Definition at line 85 of file OgreResource.h. |
|
Optional manual loader; if provided, data is loaded from here instead of a file.
Definition at line 89 of file OgreResource.h. |
|
Definition at line 259 of file OgreTexture.h. |
|
Unique name of the resource.
Definition at line 75 of file OgreResource.h. |
|
Definition at line 258 of file OgreTexture.h. |
|
Definition at line 257 of file OgreTexture.h. |
|
Origin of this resource (e.g. script name) - optional.
Definition at line 87 of file OgreResource.h. |
|
Class name for this instance to be used as a lookup (must be initialised by subclasses).
Definition at line 160 of file OgreStringInterface.h. |
|
cubic texture pointer
Definition at line 52 of file OgreD3D9Texture.h. Referenced by getCubeTexture(). |
|
D3D9 pointer.
Definition at line 48 of file OgreD3D9Texture.h. |
|
D3DDevice pointer.
Definition at line 46 of file OgreD3D9Texture.h. |
|
1D/2D normal texture pointer
Definition at line 50 of file OgreD3D9Texture.h. Referenced by getNormTexture(). |
|
actual texture pointer
Definition at line 56 of file OgreD3D9Texture.h. Referenced by getTexture(). |
|
Volume texture.
Definition at line 54 of file OgreD3D9Texture.h. |
|
Dictionary of parameters.
Definition at line 157 of file OgreStringInterface.h. |
|
The size of the resource in bytes.
Definition at line 83 of file OgreResource.h. |
|
Definition at line 266 of file OgreTexture.h. |
|
Definition at line 267 of file OgreTexture.h. |
|
Definition at line 267 of file OgreTexture.h. |
|
Definition at line 267 of file OgreTexture.h. |
|
Definition at line 72 of file OgreD3D9Texture.h. |
|
Definition at line 262 of file OgreTexture.h. |
|
Definition at line 264 of file OgreTexture.h. |
|
Definition at line 254 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 Mar 12 14:51:18 2006