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.

63 lines
2.5 KiB

  1. //========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Has init functions for all the standard render targets used by most games.
  4. // Mods who wish to make their own render targets can inherit from this class
  5. // and in the 'InitClientRenderTargets' interface called by the engine, set up
  6. // their own render targets as well as calling the init functions for various
  7. // common render targets provided by this class.
  8. //
  9. // Note: Unless the client defines a singleton interface by inheriting from
  10. // this class and exposing the singleton instance, these init and shutdown
  11. // functions WILL NOT be called by the engine.
  12. //
  13. //
  14. // $Workfile: $
  15. // $Date: $
  16. // $NoKeywords: $
  17. //===========================================================================//
  18. #ifndef CLIENTRENDERTARTETS_H_
  19. #define CLIENTRENDERTARTETS_H_
  20. #ifdef _WIN32
  21. #pragma once
  22. #endif
  23. #include "game/client/iclientrendertargets.h" // base class with interfaces called by the engine
  24. #include "materialsystem/imaterialsystem.h" // for material system classes and interfaces
  25. // Externs
  26. class IMaterialSystem;
  27. class IMaterialSystemHardwareConfig;
  28. class CBaseClientRenderTargets : public IClientRenderTargets
  29. {
  30. // no networked vars
  31. DECLARE_CLASS_GAMEROOT( CBaseClientRenderTargets, IClientRenderTargets );
  32. public:
  33. // Interface called by engine during material system startup.
  34. virtual void InitClientRenderTargets ( IMaterialSystem* pMaterialSystem, IMaterialSystemHardwareConfig* pHardwareConfig );
  35. // Shutdown all custom render targets here.
  36. virtual void ShutdownClientRenderTargets ( void );
  37. protected:
  38. void SetupClientRenderTargets( IMaterialSystem* pMaterialSystem, IMaterialSystemHardwareConfig* pHardwareConfig, int iWaterTextureSize = 1024, int iCameraTextureSize = 256 );
  39. // Standard render textures used by most mods-- Classes inheriting from
  40. // this can choose to init these or not depending on their needs.
  41. // For reflective and refracting water
  42. CTextureReference m_WaterReflectionTexture;
  43. CTextureReference m_WaterRefractionTexture;
  44. // Used for monitors
  45. CTextureReference m_CameraTexture;
  46. CTextureReference m_RenderToRTHelperTexture;
  47. // Init functions for the common render targets
  48. ITexture* CreateWaterReflectionTexture( IMaterialSystem* pMaterialSystem, int iSize = 1024 );
  49. ITexture* CreateWaterRefractionTexture( IMaterialSystem* pMaterialSystem, int iSize = 1024 );
  50. ITexture* CreateCameraTexture( IMaterialSystem* pMaterialSystem, int iSize = 256 );
  51. };
  52. #endif // CLIENTRENDERTARTETS_H_