#include <OgreGLTexture.h>
Inheritance diagram for Ogre::GLTexture:
Public Methods | |
GLTexture (const String &name, GLSupport &support, TextureType texType=TEX_TYPE_2D) | |
GLTexture (const String &name, GLSupport &support, TextureType texType, uint width, uint height, uint num_mips, PixelFormat format, TextureUsage usage) | |
virtual | ~GLTexture () |
void | load () |
Loads the resource, if it is not already. | |
void | loadImage (const Image &img) |
Loads the data from an image. | |
void | loadImages (const std::vector< Image > &images) |
void | unload () |
Unloads the resource, but retains data to recreate. | |
void | createRenderTexture () |
void | blitToTexture (const Image &src, unsigned uStartX, unsigned uStartY) |
Blits the contents of src on the texture. | |
GLenum | getGLTextureType (void) const |
GLenum | getGLTextureFormat (void) const |
GLuint | getGLID () const |
TextureType | getTextureType (void) const |
Gets the type of texture. | |
unsigned short | getNumMipMaps (void) const |
Gets the number of mipmaps to be used for this texture. | |
void | setNumMipMaps (unsigned short num) |
Sets the number of mipmaps to be used for this texture. | |
float | getGamma (void) const |
Returns the gamma adjustment factor applied to this texture. | |
void | setGamma (float g) |
Sets the gamma adjustment factor applied to this texture. | |
unsigned int | getHeight (void) const |
Returns the height of the texture. | |
unsigned int | getWidth (void) const |
Returns the width of the texture. | |
unsigned int | getDepth (void) const |
Returns the depth of the texture (only applicable for 3D textures). | |
std::pair< uint, uint > | getDimensions () const |
Returns both the width and height of the texture. | |
TextureUsage | getUsage () const |
Returns the TextureUsage indentifier for this Texture. | |
virtual void | blitImage (const Image &src, const Image::Rect imgRect, const Image::Rect texRect) |
Blits a rect from an image to the texture. | |
virtual void | copyToTexture (Texture *target) |
Copies (and maybe scales to fit) the contents of this texture to another texture. | |
virtual void | loadRawData (const DataChunk &pData, ushort uWidth, ushort uHeight, PixelFormat eFormat) |
Loads the data from the raw memory area. | |
void | enable32Bit (bool setting=true) |
virtual PixelFormat | getFormat () const |
Returns the pixel format for the texture surface. | |
virtual bool | hasAlpha (void) const |
Returns true if the texture has an alpha layer. | |
virtual 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. | |
time_t | getLastAccess (void) const |
Gets the last time the resource was 'touched'. | |
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. | |
virtual void | destroy () |
A method to make the resource delete itself. | |
Protected Methods | |
void | generateMipMaps (const uchar *data, bool useSoftware, bool isCompressed, size_t faceNumber) |
uchar * | rescaleNPower2 (const Image &src) |
Protected Attributes | |
unsigned long | mHeight |
unsigned long | mWidth |
unsigned long | mDepth |
unsigned short | mNumMipMaps |
float | mGamma |
TextureType | mTextureType |
PixelFormat | mFormat |
TextureUsage | mUsage |
unsigned short | mSrcBpp |
unsigned long | mSrcWidth |
unsigned long | mSrcHeight |
unsigned short | mFinalBpp |
bool | mHasAlpha |
String | mName |
ResourceHandle | mHandle |
bool | mIsLoaded |
time_t | mLastAccess |
size_t | mSize |
Private Attributes | |
GLuint | mTextureID |
GLSupport & | mGLSupport |
|
Definition at line 55 of file OgreGLTexture.cpp. References Ogre::Texture::enable32Bit(), Ogre::Resource::mName, Ogre::Texture::mTextureType, Ogre::Texture::mUsage, Ogre::String, Ogre::TextureType, and Ogre::TU_DEFAULT. |
|
Definition at line 65 of file OgreGLTexture.cpp. References Ogre::PixelFormat, Ogre::String, Ogre::TextureType, Ogre::TextureUsage, and Ogre::uint. |
|
Definition at line 74 of file OgreGLTexture.cpp. References unload(). |
|
Blits a rect from an image to the texture.
Reimplemented in Ogre::D3DTexture, and Ogre::D3D9Texture. Definition at line 136 of file OgreTexture.h. |
|
Blits the contents of src on the texture.
Implements Ogre::Texture. Definition at line 121 of file OgreGLTexture.cpp. References Ogre::GLSupport::begin_context(), Ogre::GLSupport::end_context(), Except, Ogre::Image::getData(), getGLTextureFormat(), Ogre::Image::getHeight(), Ogre::Texture::getTextureType(), Ogre::Image::getWidth(), mGLSupport, mTextureID, and Ogre::TEX_TYPE_2D. |
|
Copies (and maybe scales to fit) the contents of this texture to another texture.
Reimplemented in Ogre::D3DTexture, and Ogre::D3D9Texture. Definition at line 143 of file OgreTexture.h. Referenced by Ogre::D3D9RenderTexture::_copyToTexture(), and Ogre::D3D7RenderTexture::_copyToTexture(). |
|
Definition at line 258 of file OgreGLTexture.cpp. References Ogre::GLSupport::begin_context(), Ogre::GLSupport::end_context(), Except, getGLTextureFormat(), Ogre::Texture::getTextureType(), mGLSupport, Ogre::Texture::mHeight, Ogre::Texture::mNumMipMaps, mTextureID, Ogre::Texture::mWidth, and Ogre::TEX_TYPE_2D. Referenced by load(). |
|
A method to make the resource delete itself.
Definition at line 137 of file OgreResource.h. |
|
Definition at line 154 of file OgreTexture.h. Referenced by Ogre::GLTextureManager::create(), Ogre::D3D9TextureManager::create(), Ogre::D3DTextureManager::create(), Ogre::D3D9TextureManager::createAsRenderTarget(), Ogre::D3DTextureManager::createAsRenderTarget(), Ogre::GLTextureManager::createManual(), GLTexture(), Ogre::TextureManager::load(), and Ogre::Texture::Texture(). |
|
|
Returns the depth of the texture (only applicable for 3D textures).
Definition at line 106 of file OgreTexture.h. |
|
Returns both the width and height of the texture.
Definition at line 110 of file OgreTexture.h. |
|
Returns the pixel format for the texture surface.
Definition at line 160 of file OgreTexture.h. References Ogre::PixelFormat. Referenced by Ogre::D3D9Texture::_blitImagesToCubeTex(). |
|
Returns the gamma adjustment factor applied to this texture.
Definition at line 88 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::loadImage(). |
|
Definition at line 66 of file OgreGLTexture.h. References mTextureID. Referenced by Ogre::GLRenderSystem::_setTexture(). |
|
Definition at line 96 of file OgreGLTexture.cpp. References GLenum, Ogre::PF_A8R8G8B8, Ogre::PF_B8G8R8, Ogre::PF_B8G8R8A8, Ogre::PF_DXT1, Ogre::PF_DXT3, Ogre::PF_DXT5, Ogre::PF_L8, and Ogre::PF_R8G8B8. Referenced by blitToTexture(), createRenderTexture(), generateMipMaps(), and rescaleNPower2(). |
|
Definition at line 79 of file OgreGLTexture.cpp. References GLenum, Ogre::TEX_TYPE_1D, Ogre::TEX_TYPE_2D, Ogre::TEX_TYPE_3D, and Ogre::TEX_TYPE_CUBE_MAP. Referenced by Ogre::GLRenderSystem::_setTexture(), generateMipMaps(), and loadImages(). |
|
Definition at line 120 of file OgreResource.h. References Ogre::ResourceHandle. Referenced by Ogre::Material::clone(), Ogre::BspLevel::loadQuake3Level(), and Ogre::ResourceManager::unload(). |
|
Returns the height of the texture.
Definition at line 98 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_blitImagesToCubeTex(), Ogre::D3DTexture::blitImage3D(), Ogre::D3D9Texture::copyToTexture(), and Ogre::TextureUnitState::getTextureDimensions(). |
|
Gets the last time the resource was 'touched'.
Definition at line 108 of file OgreResource.h. |
|
|
Gets the number of mipmaps to be used for this texture.
Definition at line 78 of file OgreTexture.h. Referenced by Ogre::GLRenderTexture::_copyToTexture(). |
|
Retrieves info about the size of the resource.
Definition at line 93 of file OgreResource.h. Referenced by Ogre::ResourceManager::unload(). |
|
Gets the type of texture.
Definition at line 74 of file OgreTexture.h. References Ogre::TextureType. Referenced by Ogre::D3D9Texture::_createTex(), Ogre::D3D9Texture::_loadNormTex(), Ogre::D3D9Texture::_setSrcAttributes(), Ogre::D3D9RenderSystem::_setTexture(), Ogre::D3DRenderSystem::_setTexture(), blitToTexture(), Ogre::D3D9Texture::copyToTexture(), createRenderTexture(), Ogre::D3D9Texture::D3D9Texture(), Ogre::D3D9Texture::load(), and Ogre::D3D9Texture::loadImage(). |
|
Returns the TextureUsage indentifier for this Texture.
Definition at line 114 of file OgreTexture.h. References Ogre::TextureUsage. Referenced by Ogre::D3D9Texture::copyToTexture(), and Ogre::D3DTexture::copyToTexture(). |
|
Returns the width of the texture.
Definition at line 102 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_blitImagesToCubeTex(), Ogre::D3DTexture::blitImage3D(), Ogre::D3D9Texture::copyToTexture(), and Ogre::TextureUnitState::getTextureDimensions(). |
|
Returns true if the texture has an alpha layer.
Definition at line 166 of file OgreTexture.h. Referenced by Ogre::Font::load(). |
|
Returns true if the Resource has been loaded, false otherwise.
Definition at line 127 of file OgreResource.h. Referenced by Ogre::GpuProgramUsage::_load(), Ogre::SceneManager::deriveShadowCasterPass(), Ogre::SceneManager::deriveShadowReceiverPass(), Ogre::Technique::isLoaded(), Ogre::D3D9Texture::load(), Ogre::D3D9Texture::unload(), and Ogre::D3D9Texture::~D3D9Texture(). |
|
Loads the resource, if it is not already.
Implements Ogre::Resource. Definition at line 276 of file OgreGLTexture.cpp. References createRenderTexture(), Except, Ogre::Image::getData(), Ogre::Image::getDepth(), Ogre::Image::getFormat(), Ogre::Image::getHeight(), Ogre::Resource::getName(), Ogre::Image::getSize(), Ogre::Image::getWidth(), Ogre::Image::hasFlag(), Ogre::IF_CUBEMAP, Ogre::Image::load(), loadImage(), loadImages(), Ogre::Image::loadRawData(), Ogre::Resource::mIsLoaded, Ogre::Resource::mName, Ogre::Texture::mTextureType, Ogre::Texture::mUsage, Ogre::String, Ogre::TEX_TYPE_1D, Ogre::TEX_TYPE_2D, Ogre::TEX_TYPE_3D, Ogre::TEX_TYPE_CUBE_MAP, Ogre::TU_RENDERTARGET, and Ogre::uint. |
|
Loads the data from an image.
Implements Ogre::Texture. Definition at line 182 of file OgreGLTexture.cpp. References loadImages(). Referenced by load(). |
|
|
Loads the data from the raw memory area.
Definition at line 54 of file OgreTexture.cpp. References Ogre::Texture::loadImage(), Ogre::Image::loadRawData(), Ogre::PixelFormat, and Ogre::ushort. Referenced by Ogre::TextureManager::loadRawData(). |
|
Definition at line 139 of file OgreGLTexture.cpp. References Ogre::GLSupport::begin_context(), Ogre::GLSupport::end_context(), Except, Ogre::Image::getData(), getGLTextureFormat(), Ogre::Image::getSize(), Ogre::Texture::mGamma, mGLSupport, Ogre::Texture::mHasAlpha, Ogre::Texture::mHeight, Ogre::mostSignificantBitSet(), Ogre::Texture::mSrcBpp, Ogre::Texture::mSrcHeight, Ogre::Texture::mSrcWidth, Ogre::Texture::mWidth, and Ogre::uchar. Referenced by loadImages(). |
|
Sets the gamma adjustment factor applied to this texture.
Definition at line 94 of file OgreTexture.h. Referenced by Ogre::TextureManager::load(), Ogre::TextureManager::loadImage(), and Ogre::TextureManager::loadRawData(). |
|
Sets the number of mipmaps to be used for this texture.
Definition at line 84 of file OgreTexture.h. Referenced by Ogre::TextureManager::load(), Ogre::TextureManager::loadImage(), and Ogre::TextureManager::loadRawData(). |
|
'Touches' the resource to indicate it has been used.
Reimplemented in Ogre::Material. Definition at line 100 of file OgreResource.h. Referenced by Ogre::Mesh::clone(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), and Ogre::ResourceManager::load(). |
|
Unloads the resource, but retains data to recreate.
Reimplemented from Ogre::Resource. Definition at line 347 of file OgreGLTexture.cpp. References Ogre::Resource::mIsLoaded, and mTextureID. Referenced by loadImages(), Ogre::GLTextureManager::unloadAndDestroyAll(), and ~GLTexture(). |
|
Definition at line 174 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_setFinalAttributes(), generateMipMaps(), and loadImages(). |
|
Definition at line 185 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_chooseD3DFormat(), Ogre::D3DTexture::_chooseD3DFormat(), Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3DTexture::blitImage(), Ogre::D3DTexture::blitImage3D(), Ogre::D3DTexture::D3DTexture(), Ogre::D3DTexture::load(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), and loadImages(). |
|
Definition at line 180 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3DTexture::D3DTexture(), generateMipMaps(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), loadImages(), and Ogre::Texture::Texture(). |
|
Definition at line 177 of file OgreTexture.h. Referenced by Ogre::D3DTexture::blitImage(), Ogre::D3DTexture::blitImage3D(), and rescaleNPower2(). |
|
Definition at line 75 of file OgreGLTexture.h. Referenced by blitToTexture(), createRenderTexture(), generateMipMaps(), loadImages(), and rescaleNPower2(). |
|
Definition at line 57 of file OgreResource.h. Referenced by Ogre::ResourceManager::add(), Ogre::Material::clone(), Ogre::Material::copyDetailsTo(), and Ogre::Material::operator=(). |
|
Definition at line 186 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_chooseD3DFormat(), Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3D9Texture::_setSrcAttributes(), Ogre::D3DTexture::D3DTexture(), generateMipMaps(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), loadImages(), rescaleNPower2(), and Ogre::Texture::Texture(). |
|
Definition at line 172 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_initMembers(), Ogre::D3D9Texture::_setFinalAttributes(), createRenderTexture(), Ogre::D3DTexture::createSurface2D(), Ogre::D3DTexture::createSurface3D(), generateMipMaps(), loadImages(), and rescaleNPower2(). |
|
|
Definition at line 59 of file OgreResource.h. Referenced by Ogre::Material::operator=(). |
|
|
Definition at line 176 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_createCubeTex(), Ogre::D3D9Texture::_createNormTex(), Ogre::D3D9Texture::_setSrcAttributes(), createRenderTexture(), Ogre::D3DTexture::createSurface2D(), Ogre::D3DTexture::createSurface3D(), Ogre::D3D9Texture::D3D9Texture(), Ogre::D3DTexture::D3DTexture(), generateMipMaps(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), and loadImages(). |
|
Definition at line 60 of file OgreResource.h. Referenced by Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), loadImages(), and Ogre::Material::operator=(). |
|
Definition at line 183 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_copyMemoryToSurface(), Ogre::D3D9Texture::_setSrcAttributes(), Ogre::D3D9Texture::blitToTexture(), Ogre::D3DTexture::D3DTexture(), Ogre::D3DTexture::load(), Ogre::D3DTexture::loadImage(), Ogre::D3DTexture::loadImage3D(), loadImages(), rescaleNPower2(), and Ogre::Texture::Texture(). |
|
|
|
Definition at line 74 of file OgreGLTexture.h. Referenced by blitToTexture(), createRenderTexture(), getGLID(), loadImages(), and unload(). |
|
Definition at line 179 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_setFinalAttributes(), Ogre::D3DTexture::createSurface(), Ogre::D3D9Texture::D3D9Texture(), Ogre::D3DTexture::D3DTexture(), generateMipMaps(), GLTexture(), load(), and Ogre::D3DTexture::load(). |
|
Definition at line 181 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_createCubeTex(), Ogre::D3D9Texture::_createNormTex(), Ogre::D3D9Texture::_setSrcAttributes(), Ogre::D3DTexture::copyToTexture(), Ogre::D3DTexture::createSurface2D(), Ogre::D3DTexture::createSurface3D(), Ogre::D3D9Texture::D3D9Texture(), Ogre::D3DTexture::D3DTexture(), GLTexture(), load(), Ogre::D3D9Texture::load(), and Ogre::D3DTexture::load(). |
|
Definition at line 173 of file OgreTexture.h. Referenced by Ogre::D3D9Texture::_initMembers(), Ogre::D3D9Texture::_setFinalAttributes(), createRenderTexture(), Ogre::D3DTexture::createSurface2D(), Ogre::D3DTexture::createSurface3D(), generateMipMaps(), loadImages(), and rescaleNPower2(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:49:38 2004