GFXGLTextureObject Class Reference

#include <gfxGLTextureObject.h>

Inheritance diagram for GFXGLTextureObject:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 GFXGLTextureObject (GFXDevice *aDevice, GFXTextureProfile *profile)
virtual ~GFXGLTextureObject ()
void release ()
GLuint getHandle () const
GLenum getBinding () const
GLuint getBuffer () const
bool isZombie () const
void bind (U32 textureUnit) const
 Binds the texture to the given texture unit and applies the current sampler state because GL tracks filtering and wrapper per object, while GFX tracks per sampler.
U8getTextureData ()
virtual F32 getMaxUCoord () const
virtual F32 getMaxVCoord () const
void reloadFromCache ()
 Reloads texture from zombie cache, used by GFXGLTextureManager to resurrect the texture.
virtual void pureVirtualCrash ()
virtual GFXLockedRectlock (U32 mipLevel=0, RectI *inRect=NULL)
 Get/set data from texture (for dynamic textures and render targets).
virtual void unlock (U32 mipLevel=0)
 Releases a lock previously acquired.
virtual bool copyToBmp (GBitmap *)
 Not implemented.
virtual bool readBackBuffer (Point2I &upperLeft)
 Copy the back buffer into this texture.
virtual void zombify ()
 When called the resource should destroy all device sensitive information (e.g. D3D resources in D3DPOOL_DEFAULT.
virtual void resurrect ()
 When called the resource should restore all device sensitive information destroyed by zombify().
virtual const String describeSelf () const
 The resource should put a description of itself (number of vertices, size/width of texture, etc.) in buffer.

Public Attributes

bool mIsNPoT2

Private Types

typedef GFXTextureObject Parent

Private Member Functions

void copyIntoCache ()

Private Attributes

GLuint mHandle
 Internal GL object.
GLuint mBuffer
GLenum mBinding
U32 mBytesPerTexel
GFXLockedRect mLockedRect
RectI mLockedRectRect
GFXGLDevicemGLDevice
 Pointer to owner device.
bool mIsZombie
U8mZombieCache

Friends

class GFXGLTextureManager

Member Typedef Documentation


Constructor & Destructor Documentation

GFXGLTextureObject::GFXGLTextureObject ( GFXDevice aDevice,
GFXTextureProfile profile 
)

virtual GFXGLTextureObject::~GFXGLTextureObject (  )  [virtual]


Member Function Documentation

void GFXGLTextureObject::release (  ) 

GLuint GFXGLTextureObject::getHandle (  )  const [inline]

GLenum GFXGLTextureObject::getBinding (  )  const [inline]

GLuint GFXGLTextureObject::getBuffer (  )  const [inline]

bool GFXGLTextureObject::isZombie (  )  const [inline]

void GFXGLTextureObject::bind ( U32  textureUnit  )  const

Binds the texture to the given texture unit and applies the current sampler state because GL tracks filtering and wrapper per object, while GFX tracks per sampler.

U8* GFXGLTextureObject::getTextureData (  ) 

Returns:
An array containing the texture data
Note:
You are responsible for deleting the returned data! (Use delete[])

virtual F32 GFXGLTextureObject::getMaxUCoord (  )  const [virtual]

Reimplemented from GFXTextureObject.

virtual F32 GFXGLTextureObject::getMaxVCoord (  )  const [virtual]

Reimplemented from GFXTextureObject.

void GFXGLTextureObject::reloadFromCache (  ) 

Reloads texture from zombie cache, used by GFXGLTextureManager to resurrect the texture.

virtual void GFXGLTextureObject::pureVirtualCrash (  )  [inline, virtual]

Implements GFXTextureObject.

virtual GFXLockedRect* GFXGLTextureObject::lock ( U32  mipLevel = 0,
RectI inRect = NULL 
) [virtual]

Get/set data from texture (for dynamic textures and render targets).

Attention:
DO NOT READ FROM THE RETURNED RECT! It is not guaranteed to work and may incur significant performance penalties.

Implements GFXTextureObject.

virtual void GFXGLTextureObject::unlock ( U32  mipLevel = 0  )  [virtual]

Releases a lock previously acquired.

Note that the mipLevel parameter must match the corresponding lock!

Implements GFXTextureObject.

virtual bool GFXGLTextureObject::copyToBmp ( GBitmap  )  [virtual]

Not implemented.

Implements GFXTextureObject.

virtual bool GFXGLTextureObject::readBackBuffer ( Point2I upperLeft  )  [virtual]

Copy the back buffer into this texture.

This texture will contain back buffer data from the rectangle: RectI( upperLeft, Point2I( getWidth(), getHeight() ) )

Note:
This texture must use a render target profile
Parameters:
upperLeft Coordinates on the screen to start the capture

Implements GFXTextureObject.

virtual void GFXGLTextureObject::zombify (  )  [virtual]

When called the resource should destroy all device sensitive information (e.g. D3D resources in D3DPOOL_DEFAULT.

Implements GFXResource.

virtual void GFXGLTextureObject::resurrect (  )  [virtual]

When called the resource should restore all device sensitive information destroyed by zombify().

Implements GFXResource.

virtual const String GFXGLTextureObject::describeSelf (  )  const [virtual]

The resource should put a description of itself (number of vertices, size/width of texture, etc.) in buffer.

Reimplemented from GFXTextureObject.

void GFXGLTextureObject::copyIntoCache (  )  [private]


Friends And Related Function Documentation

friend class GFXGLTextureManager [friend]


Member Data Documentation

Internal GL object.

Pointer to owner device.