GFXResource Class Reference

#include <gfxResource.h>

Inheritance diagram for GFXResource:

Inheritance graph
[legend]
List of all members.

Detailed Description

Mixin for the purpose of tracking GFX resources owned by a GFXDevice.

There are many types of resource that are allocated from a GFXDevice that must be participatory in device resets. For instance, all default pool DirectX resources have to be involved when the device resets. Render targets in all APIs need to unbind themselves when resets happen.

This system is also handy for accounting purposes. For instance, we may want to traverse all registered VBs, IBs, Textures, or RTs in order to determine what, if any, items are still allocated. This can be used in leak reports, memory usage reports, etc.


Public Member Functions

 GFXResource ()
virtual ~GFXResource ()
void registerResourceWithDevice (GFXDevice *device)
 Registers this resource with the given device.
virtual void zombify ()=0
 When called the resource should destroy all device sensitive information (e.g. D3D resources in D3DPOOL_DEFAULT.
virtual void resurrect ()=0
 When called the resource should restore all device sensitive information destroyed by zombify().
virtual const String describeSelf () const =0
 The resource should put a description of itself (number of vertices, size/width of texture, etc.) in buffer.
GFXResourcegetNextResource () const
GFXResourcegetPrevResource () const
GFXDevicegetOwningDevice () const
bool isFlagged ()
void setFlag ()
void clearFlag ()

Private Attributes

GFXResourcemPrevResource
GFXResourcemNextResource
GFXDevicemOwningDevice
bool mFlagged
 Helper flag to check new resource allocations.

Friends

class GFXDevice


Constructor & Destructor Documentation

GFXResource::GFXResource (  ) 

virtual GFXResource::~GFXResource (  )  [virtual]


Member Function Documentation

void GFXResource::registerResourceWithDevice ( GFXDevice device  ) 

Registers this resource with the given device.

virtual const String GFXResource::describeSelf (  )  const [pure virtual]

GFXResource* GFXResource::getNextResource (  )  const [inline]

GFXResource* GFXResource::getPrevResource (  )  const [inline]

GFXDevice* GFXResource::getOwningDevice (  )  const [inline]

bool GFXResource::isFlagged (  )  [inline]

void GFXResource::setFlag (  )  [inline]

void GFXResource::clearFlag (  )  [inline]


Friends And Related Function Documentation

friend class GFXDevice [friend]


Member Data Documentation

Helper flag to check new resource allocations.