Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Contains all texture state for the material system surface to use
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef TEXTUREDICTIONARY_H
  9. #define TEXTUREDICTIONARY_H
  10. class IMaterial;
  11. enum
  12. {
  13. INVALID_TEXTURE_ID = -1
  14. };
  15. //-----------------------------------------------------------------------------
  16. // A class that manages textures used by the material system surface
  17. //-----------------------------------------------------------------------------
  18. class ITextureDictionary
  19. {
  20. public:
  21. // Create, destroy textures
  22. virtual int CreateTexture( bool procedural = false ) = 0;
  23. virtual void DestroyTexture( int id ) = 0;
  24. virtual void DestroyAllTextures() = 0;
  25. // Is this a valid id?
  26. virtual bool IsValidId( int id ) const = 0;
  27. // Binds a material to a texture
  28. virtual void BindTextureToFile( int id, const char *pFileName ) = 0;
  29. // Binds a material to a texture
  30. virtual void BindTextureToMaterial( int id, IMaterial *pMaterial ) = 0;
  31. // Binds a material to a texture
  32. virtual void BindTextureToMaterialReference( int id, int referenceId, IMaterial *pMaterial ) = 0;
  33. // Texture info
  34. virtual IMaterial *GetTextureMaterial( int id ) = 0;
  35. virtual void GetTextureSize(int id, int& iWide, int& iTall ) = 0;
  36. virtual void GetTextureTexCoords( int id, float &s0, float &t0, float &s1, float &t1 ) = 0;
  37. virtual void SetTextureRGBA( int id, const char* rgba, int wide, int tall ) = 0;
  38. virtual int FindTextureIdForTextureFile( char const *pFileName ) = 0;
  39. virtual void SetSubTextureRGBA( int id, int drawX, int drawY, unsigned const char *rgba, int subTextureWide, int subTextureTall ) = 0;
  40. virtual void SetSubTextureRGBAEx( int id, int drawX, int drawY, unsigned const char *rgba, int subTextureWide, int subTextureTall, ImageFormat format ) = 0;
  41. virtual void SetTextureRGBAEx( int id, const char* rgba, int wide, int tall, ImageFormat format, bool bFixupTextCoordsForDimensions ) = 0;
  42. virtual void UpdateSubTextureRGBA( int id, int drawX, int drawY, unsigned const char *rgba, int subTextureWide, int subTextureTall, ImageFormat imageFormat ) = 0;
  43. };
  44. ITextureDictionary *TextureDictionary();
  45. #endif // TEXTUREDICTIONARY_H