Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::D3D8Texture Class Reference

#include <OgreD3D8Texture.h>

Inheritance diagram for Ogre::D3D8Texture:

Ogre::Texture Ogre::Resource List of all members.

Public Methods

 D3D8Texture (String name, LPDIRECT3DDEVICE8 pD3DDevice, TextureUsage usage)
 D3D8Texture (String name, IDirect3DDevice8 *device, uint width, uint height, uint num_mips, PixelFormat format, TextureUsage usage)
virtual ~D3D8Texture ()
virtual void blitToTexture (const Image &src, unsigned uStartX, unsigned uStartY)
 Blits the contents of src on the texture. More...

virtual void copyToTexture (Texture *target)
 Copies (and maybe scales to fit) the contents of this texture to another texture. More...

virtual void load ()
 Loads the resource, if it is not already. More...

virtual void loadImage (const Image &img)
 Loads the data from an image. More...

virtual void unload ()
 Unloads the resource, but retains data to recreate. More...

virtual void getCustomAttribute (String name, void *pData)
virtual void outputText (int x, int y, const String &text)
IDirect3DTexture8 * getD3DTexture ()
IDirect3DSurface8 * getDepthStencil ()
unsigned short getNumMipMaps (void)
 Gets the number of mipmaps to be used for this texture. More...

void setNumMipMaps (unsigned short num)
 Sets the number of mipmaps to be used for this texture. More...

float getGamma (void)
 Returns the gamma adjustment factor applied to this texture. More...

void setGamma (float g)
 Sets the gamma adjustment factor applied to this texture. More...

unsigned int getHeight (void)
 Returns the height of the texture. More...

unsigned int getWidth (void)
 Returns the width of the texture. More...

std::pair< uint, uintgetDimensions ()
 Returns both the width and height of the texture. More...

TextureUsage getUsage () const
virtual void blitImage (const Image &src, const Image::Rect imgRect, const Image::Rect texRect)
 Blits a rect from an image to the texture. More...

void enable32Bit (bool setting=true)
virtual PixelFormat getFormat () const
 Returns the pixel format for the texture surface. More...

virtual bool hasAlpha (void)
 Returns true if the texture has an alpha layer. More...

virtual size_t getSize (void)
 Retrieves info about the size of the resource. More...

void touch (void)
 'Touches' the resource to indicate it has been used. More...

time_t getLastAccess (void) const
 Gets the last time the resource was 'touched'. More...

const StringgetName (void) const
 Gets resource name. More...

bool isLoaded (void) const
 Returns true if the Resource has been loaded, false otherwise. More...

virtual void destroy ()
 A method to make the resource delete itself. More...


Protected Methods

void createTexture ()
void copyMemoryToTexture (unsigned char *pBuffer)
void getColourMasks (D3DFORMAT format, DWORD *pdwRed, DWORD *pdwGreen, DWORD *pdwBlue, DWORD *pdwAlpha, DWORD *pdwRGBBitCount)
 We also create a depth buffer for our render target. More...


Protected Attributes

LPDIRECT3DDEVICE8 mpD3DDevice
LPDIRECT3DTEXTURE8 mpTexture
LPDIRECT3DSURFACE8 mpRenderZBuffer
LPDIRECT3DTEXTURE8 mpTempTexture
bool m_bIsRenderTarget
unsigned long mHeight
unsigned long mWidth
unsigned short mNumMipMaps
float mGamma
PixelFormat mFormat
TextureUsage mUsage
unsigned short mSrcBpp
unsigned long mSrcWidth
unsigned long mSrcHeight
unsigned short mFinalBpp
bool mHasAlpha
String mName
bool mIsLoaded
time_t mLastAccess
size_t mSize

Constructor & Destructor Documentation

Ogre::D3D8Texture::D3D8Texture String    name,
LPDIRECT3DDEVICE8    pD3DDevice,
TextureUsage    usage
 

Ogre::D3D8Texture::D3D8Texture String    name,
IDirect3DDevice8 *    device,
uint    width,
uint    height,
uint    num_mips,
PixelFormat    format,
TextureUsage    usage
 

Ogre::D3D8Texture::~D3D8Texture   [virtual]
 


Member Function Documentation

virtual void Ogre::Texture::blitImage const Image   src,
const Image::Rect    imgRect,
const Image::Rect    texRect
[inline, virtual, inherited]
 

Blits a rect from an image to the texture.

Parameters:
src  The image with the source data.
imgRect  The data rect to be copied from the image.
texRect  The rect in which to copy the data in the texture.

Reimplemented in Ogre::D3DTexture.

void Ogre::D3D8Texture::blitToTexture const Image   src,
unsigned    uStartX,
unsigned    uStartY
[virtual]
 

Blits the contents of src on the texture.

Deprecated:
This feature is superseded by the blitImage function.
Parameters:
src  the image with the source data

Implements Ogre::Texture.

void Ogre::D3D8Texture::copyMemoryToTexture unsigned char *    pBuffer [protected]
 

void Ogre::D3D8Texture::copyToTexture Texture   target [virtual]
 

Copies (and maybe scales to fit) the contents of this texture to another texture.

Reimplemented from Ogre::Texture.

void Ogre::D3D8Texture::createTexture   [protected]
 

virtual void Ogre::Resource::destroy void    [inline, virtual, inherited]
 

A method to make the resource delete itself.

Note:
This exists because Resource objects could be created in other processes, and they need to be destroyed in the process that created them.

void Ogre::Texture::enable32Bit bool    setting = true [inline, inherited]
 

void Ogre::D3D8Texture::getColourMasks D3DFORMAT    format,
DWORD *    pdwRed,
DWORD *    pdwGreen,
DWORD *    pdwBlue,
DWORD *    pdwAlpha,
DWORD *    pdwRGBBitCount
[protected]
 

We also create a depth buffer for our render target.

void Ogre::D3D8Texture::getCustomAttribute String    name,
void *    pData
[virtual]
 

IDirect3DTexture8* Ogre::D3D8Texture::getD3DTexture   [inline]
 

IDirect3DSurface8* Ogre::D3D8Texture::getDepthStencil   [inline]
 

std::pair< uint, uint > Ogre::Texture::getDimensions   [inline, inherited]
 

Returns both the width and height of the texture.

virtual PixelFormat Ogre::Texture::getFormat   const [inline, virtual, inherited]
 

Returns the pixel format for the texture surface.

float Ogre::Texture::getGamma void    [inline, inherited]
 

Returns the gamma adjustment factor applied to this texture.

unsigned int Ogre::Texture::getHeight void    [inline, inherited]
 

Returns the height of the texture.

time_t Ogre::Resource::getLastAccess void    const [inline, inherited]
 

Gets the last time the resource was 'touched'.

const String& Ogre::Resource::getName void    const [inline, inherited]
 

Gets resource name.

Reimplemented in Ogre::Material.

unsigned short Ogre::Texture::getNumMipMaps void    [inline, inherited]
 

Gets the number of mipmaps to be used for this texture.

virtual size_t Ogre::Resource::getSize void    [inline, virtual, inherited]
 

Retrieves info about the size of the resource.

TextureUsage Ogre::Texture::getUsage   const [inline, inherited]
 

unsigned int Ogre::Texture::getWidth void    [inline, inherited]
 

Returns the width of the texture.

virtual bool Ogre::Texture::hasAlpha void    [inline, virtual, inherited]
 

Returns true if the texture has an alpha layer.

bool Ogre::Resource::isLoaded void    const [inline, inherited]
 

Returns true if the Resource has been loaded, false otherwise.

void Ogre::D3D8Texture::load   [virtual]
 

Loads the resource, if it is not already.

Implements Ogre::Resource.

void Ogre::D3D8Texture::loadImage const Image   img [virtual]
 

Loads the data from an image.

Implements Ogre::Texture.

virtual void Ogre::D3D8Texture::outputText int    x,
int    y,
const String   text
[inline, virtual]
 

void Ogre::Texture::setGamma float    g [inline, inherited]
 

Sets the gamma adjustment factor applied to this texture.

Note:
Must be called before any 'load' method.

void Ogre::Texture::setNumMipMaps unsigned short    num [inline, inherited]
 

Sets the number of mipmaps to be used for this texture.

Note:
Must be set before calling any 'load' method.

void Ogre::Resource::touch void    [inline, inherited]
 

'Touches' the resource to indicate it has been used.

void Ogre::D3D8Texture::unload void    [virtual]
 

Unloads the resource, but retains data to recreate.

Reimplemented from Ogre::Resource.


Member Data Documentation

bool Ogre::D3D8Texture::m_bIsRenderTarget [protected]
 

unsigned short Ogre::Texture::mFinalBpp [protected, inherited]
 

PixelFormat Ogre::Texture::mFormat [protected, inherited]
 

float Ogre::Texture::mGamma [protected, inherited]
 

bool Ogre::Texture::mHasAlpha [protected, inherited]
 

unsigned long Ogre::Texture::mHeight [protected, inherited]
 

bool Ogre::Resource::mIsLoaded [protected, inherited]
 

time_t Ogre::Resource::mLastAccess [protected, inherited]
 

String Ogre::Resource::mName [protected, inherited]
 

unsigned short Ogre::Texture::mNumMipMaps [protected, inherited]
 

LPDIRECT3DDEVICE8 Ogre::D3D8Texture::mpD3DDevice [protected]
 

LPDIRECT3DSURFACE8 Ogre::D3D8Texture::mpRenderZBuffer [protected]
 

LPDIRECT3DTEXTURE8 Ogre::D3D8Texture::mpTempTexture [protected]
 

LPDIRECT3DTEXTURE8 Ogre::D3D8Texture::mpTexture [protected]
 

size_t Ogre::Resource::mSize [protected, inherited]
 

unsigned short Ogre::Texture::mSrcBpp [protected, inherited]
 

unsigned long Ogre::Texture::mSrcHeight [protected, inherited]
 

unsigned long Ogre::Texture::mSrcWidth [protected, inherited]
 

TextureUsage Ogre::Texture::mUsage [protected, inherited]
 

unsigned long Ogre::Texture::mWidth [protected, inherited]
 

Copyright © 2002 by The OGRE Team