Team Fortress 2 Source Code as on 22/4/2020
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.

53 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // A class representing a shader
  4. //
  5. //=============================================================================
  6. #ifndef DMESHADER_H
  7. #define DMESHADER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "datamodel/dmelement.h"
  12. //-----------------------------------------------------------------------------
  13. // Forward declarations
  14. //-----------------------------------------------------------------------------
  15. class IShader;
  16. //-----------------------------------------------------------------------------
  17. // A class representing a material
  18. //-----------------------------------------------------------------------------
  19. class CDmeShader : public CDmElement
  20. {
  21. DEFINE_ELEMENT( CDmeShader, CDmElement );
  22. public:
  23. void SetShaderName( const char *pShaderName );
  24. const char *GetShaderName() const;
  25. // Resolve
  26. virtual void Resolve();
  27. private:
  28. // Finds a shader
  29. IShader *FindShader();
  30. // Remove all shader parameters that don't exist in the new shader
  31. void RemoveUnusedShaderParams( IShader *pShader );
  32. // Add all shader parameters that don't currently exist
  33. void AddNewShaderParams( IShader *pShader );
  34. // Add attribute for shader parameter
  35. CDmAttribute* AddAttributeForShaderParameter( IShader *pShader, int nIndex );
  36. IShader *m_pShader;
  37. CDmAttributeVarString m_ShaderName;
  38. };
  39. #endif // DMESHADER_H