diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/portal/portal_render_targets.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/portal/portal_render_targets.h')
| -rw-r--r-- | game/client/portal/portal_render_targets.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/game/client/portal/portal_render_targets.h b/game/client/portal/portal_render_targets.h new file mode 100644 index 0000000..59f3010 --- /dev/null +++ b/game/client/portal/portal_render_targets.h @@ -0,0 +1,61 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Portal mod render targets are specified by and accessable through this singleton +// +// +// $Workfile: $ +// $Date: $ +// $NoKeywords: $ +//=============================================================================// +#ifndef PORTALRENDERTARGETS_H_ +#define PORTALRENDERTARGETS_H_ +#ifdef _WIN32 +#pragma once +#endif + +#include "baseclientrendertargets.h" // Base class, with interfaces called by engine and inherited members to init common render targets + +#ifndef PORTAL +#pragma message ( "This file should only be built with portal builds" ) +#endif + +// externs +class IMaterialSystem; +class IMaterialSystemHardwareConfig; + +class CPortalRenderTargets : public CBaseClientRenderTargets +{ + // no networked vars + DECLARE_CLASS_GAMEROOT( CPortalRenderTargets, CBaseClientRenderTargets ); +public: + virtual void InitClientRenderTargets( IMaterialSystem* pMaterialSystem, IMaterialSystemHardwareConfig* pHardwareConfig ); + virtual void ShutdownClientRenderTargets(); + + ITexture* GetPortal1Texture( void ); + ITexture* GetPortal2Texture( void ); + ITexture* GetDepthDoublerTexture( void ); + + //recursive views require different water textures + ITexture* GetWaterReflectionTextureForStencilDepth( int iStencilDepth ); + ITexture* GetWaterRefractionTextureForStencilDepth( int iStencilDepth ); + +private: + CTextureReference m_Portal1Texture; + CTextureReference m_Portal2Texture; + CTextureReference m_DepthDoublerTexture; + + CTextureReference m_WaterRefractionTextures[2]; + CTextureReference m_WaterReflectionTextures[2]; + + ITexture* InitPortal1Texture ( IMaterialSystem* pMaterialSystem ); + ITexture* InitPortal2Texture ( IMaterialSystem* pMaterialSystem ); + ITexture* InitDepthDoublerTexture ( IMaterialSystem* pMaterialSystem ); + + void InitPortalWaterTextures ( IMaterialSystem* pMaterialSystem ); + +}; + +extern CPortalRenderTargets* portalrendertargets; + + +#endif //PORTALRENDERTARGETS_H_
\ No newline at end of file |