ITextureRegenerator: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎top: Unicodifying)
 
(23 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Interfaces]]
;Location:<code>public\materialsystem\itexture.h</code>
 
;Purpose:The job '''ITextureRegenerator''' class is to change the pixel values of any procedural texture that uses a regenerator that implements this class.
'''Location'''<br>
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
itexture.h
//
 
  // Purpose:
'''Purpose'''<br>
//
The job ITextureRegenerator class is to change the pixel values of any procedural texture that uses a regenerator that implements this class.
  // $NoKeywords: $
 
//
=The Methods=
//=============================================================================//
This method does the actual pixel changing.
  void RegenerateTextureBits( ITexture *pTexture, IVTFTexture *pVTFTexture, Rect_t *pRect )
#ifndef ITEXTURE_H
Use this method to do any cleaning up.
#define ITEXTURE_H
  void Release()
 
#ifdef _WIN32
=The Interface=
#pragma once
#endif
enum ImageFormat;
class [[IVTFTexture]];
class [[ITexture]];
struct [[Rect_t]];
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  // This will get called on procedural textures to re-fill the textures
  // This will get called on procedural textures to re-fill the textures
Line 28: Line 35:
  // The rect specifies which part of the texture needs to be updated
  // The rect specifies which part of the texture needs to be updated
  // You can choose to update all of the bits if you prefer
  // You can choose to update all of the bits if you prefer
  virtual void RegenerateTextureBits( ITexture *pTexture, IVTFTexture *pVTFTexture, Rect_t *pRect ) = 0;
  virtual void [[RegenerateTextureBits]]( [[ITexture]] *pTexture, [[IVTFTexture]] *pVTFTexture, [[Rect_t]] *pRect ) = 0;
   
   
  // This will be called when the regenerator needs to be deleted
  // This will be called when the regenerator needs to be deleted
  // which will happen when the texture is destroyed
  // which will happen when the texture is destroyed
  virtual void Release() = 0;
  virtual void [[Release]]() = 0;
  };
  };
inline bool IsErrorTexture( ITexture *pTex )
{
return !pTex || pTex->IsError();
}
#endif // ITEXTURE_H
== See also ==
* [[Procedural Materials]]
[[Category:Interfaces]]

Latest revision as of 10:10, 8 January 2024

Location
public\materialsystem\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.
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//

#ifndef ITEXTURE_H
#define ITEXTURE_H

#ifdef _WIN32
#pragma once
#endif

enum ImageFormat;
class IVTFTexture;
class ITexture;
struct Rect_t;

//-----------------------------------------------------------------------------
// 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;
};

inline bool IsErrorTexture( ITexture *pTex )
{
	return !pTex || pTex->IsError();
}

#endif // ITEXTURE_H

See also