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.

89 lines
3.0 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef ICLIENTALPHAPROPERTY_H
  8. #define ICLIENTALPHAPROPERTY_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "interface.h"
  13. #include "iclientunknown.h"
  14. #include "appframework/iappsystem.h"
  15. #include "const.h"
  16. enum ClientAlphaDistanceFadeMode_t
  17. {
  18. CLIENT_ALPHA_DISTANCE_FADE_USE_CENTER = 0,
  19. CLIENT_ALPHA_DISTANCE_FADE_USE_NEAREST_BBOX,
  20. CLIENT_ALPHA_DISTANCE_FADE_MODE_COUNT,
  21. };
  22. //-----------------------------------------------------------------------------
  23. // NOTE: Clients are *not* expected to implement this interface
  24. // Instead, these are managed completely by the client DLL.
  25. // Use the IClientTranslucency manager to allocate + free IClientTranslucency objects
  26. //-----------------------------------------------------------------------------
  27. abstract_class IClientAlphaProperty
  28. {
  29. public:
  30. // Gets at the containing class...
  31. virtual IClientUnknown* GetIClientUnknown() = 0;
  32. // Sets a constant alpha modulation value
  33. virtual void SetAlphaModulation( uint8 a ) = 0;
  34. // Sets an FX function
  35. // NOTE: kRenderFxFadeSlow, kRenderFxFadeFast, kRenderFxSolidSlow, kRenderFxSolidFast all need a start time only.
  36. // kRenderFxFadeIn/kRenderFxFadeOut needs start time + duration
  37. // All other render fx require no parameters
  38. virtual void SetRenderFX( RenderFx_t nRenderFx, RenderMode_t nRenderMode, float flStartTime = FLT_MAX, float flDuration = 0.0f ) = 0;
  39. // Sets fade parameters
  40. virtual void SetFade( float flGlobalFadeScale, float flDistFadeStart, float flDistFadeEnd ) = 0;
  41. // Sets desync offset, used to make sine waves not match
  42. virtual void SetDesyncOffset( int nOffset ) = 0;
  43. // Allows the owner to override alpha.
  44. // The method IClientRenderable::OverrideAlphaModulation will be called
  45. // to allow the owner to optionally return a different alpha modulation
  46. virtual void EnableAlphaModulationOverride( bool bEnable ) = 0;
  47. // Allows the owner to override projected shadow alpha.
  48. // The method IClientRenderable::OverrideShadowAlphaModulation will be called
  49. // to allow the owner to optionally return a different alpha modulation for the shadow
  50. virtual void EnableShadowAlphaModulationOverride( bool bEnable ) = 0;
  51. // Sets the distance fade mode
  52. virtual void SetDistanceFadeMode( ClientAlphaDistanceFadeMode_t nFadeMode ) = 0;
  53. };
  54. //-----------------------------------------------------------------------------
  55. // Manager used to deal with client translucency
  56. //-----------------------------------------------------------------------------
  57. #define CLIENT_ALPHA_PROPERTY_MGR_INTERFACE_VERSION "ClientAlphaPropertyMgrV001"
  58. abstract_class IClientAlphaPropertyMgr
  59. {
  60. public:
  61. // Class factory
  62. virtual IClientAlphaProperty *CreateClientAlphaProperty( IClientUnknown *pUnk ) = 0;
  63. virtual void DestroyClientAlphaProperty( IClientAlphaProperty *pAlphaProperty ) = 0;
  64. };
  65. #ifndef SWDS
  66. extern IClientAlphaPropertyMgr *g_pClientAlphaPropertyMgr;
  67. #endif
  68. #endif // ICLIENTALPHAPROPERTY_H