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.

91 lines
2.9 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef IMORPHINTERNAL_H
  7. #define IMORPHINTERNAL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "materialsystem/imorph.h"
  12. #include "shaderapi/shareddefs.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. class ITextureInternal;
  17. //-----------------------------------------------------------------------------
  18. // Render context for morphs
  19. //-----------------------------------------------------------------------------
  20. abstract_class IMorphMgrRenderContext
  21. {
  22. public:
  23. };
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Morph data class
  27. //
  28. //-----------------------------------------------------------------------------
  29. abstract_class IMorphInternal : public IMorph
  30. {
  31. public:
  32. virtual void Init( MorphFormat_t format, const char *pDebugName ) = 0;
  33. virtual bool Bind( IMorphMgrRenderContext *pRenderContext ) = 0;
  34. virtual MorphFormat_t GetMorphFormat() const = 0;
  35. };
  36. //-----------------------------------------------------------------------------
  37. // Morph manager class
  38. //-----------------------------------------------------------------------------
  39. abstract_class IMorphMgr
  40. {
  41. public:
  42. // Allocate,free scratch textures + materials
  43. virtual bool ShouldAllocateScratchTextures() = 0;
  44. virtual void AllocateScratchTextures() = 0;
  45. virtual void FreeScratchTextures() = 0;
  46. virtual void AllocateMaterials() = 0;
  47. virtual void FreeMaterials() = 0;
  48. // Returns the morph accumulator scratch texture
  49. virtual ITextureInternal *MorphAccumulator() = 0;
  50. virtual ITextureInternal *MorphWeights() = 0;
  51. // Class factory
  52. virtual IMorphInternal *CreateMorph() = 0;
  53. virtual void DestroyMorph( IMorphInternal *pMorphData ) = 0;
  54. // Max morphs between Begin/End
  55. virtual int MaxHWMorphBatchCount() const = 0;
  56. // Begin, end morph accumulation phase
  57. virtual void BeginMorphAccumulation( IMorphMgrRenderContext *pRenderContext ) = 0;
  58. virtual void EndMorphAccumulation( IMorphMgrRenderContext *pRenderContext ) = 0;
  59. // Accumulate a morph
  60. virtual void AccumulateMorph( IMorphMgrRenderContext *pRenderContext, IMorph* pMorph, int nMorphCount, const MorphWeight_t* pWeights ) = 0;
  61. // Advances frame count (for debugging)
  62. virtual void AdvanceFrame() = 0;
  63. // Returns the location of a particular vertex in the morph accumulator
  64. virtual bool GetMorphAccumulatorTexCoord( IMorphMgrRenderContext *pRenderContext, Vector2D *pTexCoord, IMorph *pMorph, int nVertex ) = 0;
  65. // Allocate, free morph mgr render context data.
  66. virtual IMorphMgrRenderContext *AllocateRenderContext() = 0;
  67. virtual void FreeRenderContext( IMorphMgrRenderContext *pRenderContext ) = 0;
  68. };
  69. extern IMorphMgr *g_pMorphMgr;
  70. #endif // IMORPHINTERNAL_H