ITextureRegenerator: Difference between revisions
Jump to navigation
Jump to search
ZeroDegrez (talk | contribs) (ITextureRegenerator Interface) |
ZeroDegrez (talk | contribs) mNo edit summary |
||
| Line 1: | Line 1: | ||
[[Category:Interfaces]] | [[Category:Interfaces]] | ||
=The Basics= | |||
'''Location'''<br> | '''Location'''<br> | ||
itexture.h | itexture.h | ||
| Line 8: | Line 8: | ||
The job ITextureRegenerator class is to change the pixel values of any procedural texture that uses a regenerator that implements this class. | The job ITextureRegenerator class is to change the pixel values of any procedural texture that uses a regenerator that implements this class. | ||
=The Methods= | |||
This method does the actual pixel changing. | This method does the actual pixel changing. | ||
void RegenerateTextureBits( ITexture *pTexture, IVTFTexture *pVTFTexture, Rect_t *pRect ) | void RegenerateTextureBits( ITexture *pTexture, IVTFTexture *pVTFTexture, Rect_t *pRect ) | ||
| Line 14: | Line 14: | ||
void Release() | void Release() | ||
=The Interface= | |||
//----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||
// This will get called on procedural textures to re-fill the textures | // This will get called on procedural textures to re-fill the textures | ||
Revision as of 11:00, 22 August 2005
The Basics
Location
itexture.h
Purpose
The job ITextureRegenerator class is to change the pixel values of any procedural texture that uses a regenerator that implements this class.
The Methods
This method does the actual pixel changing.
void RegenerateTextureBits( ITexture *pTexture, IVTFTexture *pVTFTexture, Rect_t *pRect )
Use this method to do any cleaning up.
void Release()
The Interface
//-----------------------------------------------------------------------------
// This will get called on procedural textures to re-fill the textures
// with the appropriate bit pattern. Calling Download() will also
// cause this interface to be called. It will also be called upon
// mode switch, or on other occasions where the bits are discarded.
//-----------------------------------------------------------------------------
class ITextureRegenerator
{
public:
// This will be called when the texture bits need to be regenerated.
// Use the VTFTexture interface, which has been set up with the
// appropriate texture size + format
// The rect specifies which part of the texture needs to be updated
// You can choose to update all of the bits if you prefer
virtual void RegenerateTextureBits( ITexture *pTexture, IVTFTexture *pVTFTexture, Rect_t *pRect ) = 0;
// This will be called when the regenerator needs to be deleted
// which will happen when the texture is destroyed
virtual void Release() = 0;
};