aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/baseclientrendertargets.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/game/client/baseclientrendertargets.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/game/client/baseclientrendertargets.h')
-rw-r--r--mp/src/game/client/baseclientrendertargets.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/mp/src/game/client/baseclientrendertargets.h b/mp/src/game/client/baseclientrendertargets.h
new file mode 100644
index 00000000..4caa8994
--- /dev/null
+++ b/mp/src/game/client/baseclientrendertargets.h
@@ -0,0 +1,64 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Has init functions for all the standard render targets used by most games.
+// Mods who wish to make their own render targets can inherit from this class
+// and in the 'InitClientRenderTargets' interface called by the engine, set up
+// their own render targets as well as calling the init functions for various
+// common render targets provided by this class.
+//
+// Note: Unless the client defines a singleton interface by inheriting from
+// this class and exposing the singleton instance, these init and shutdown
+// functions WILL NOT be called by the engine.
+//
+//
+// $Workfile: $
+// $Date: $
+// $NoKeywords: $
+//=============================================================================//
+#ifndef CLIENTRENDERTARTETS_H_
+#define CLIENTRENDERTARTETS_H_
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "game/client/iclientrendertargets.h" // base class with interfaces called by the engine
+#include "materialsystem/imaterialsystem.h" // for material system classes and interfaces
+
+
+// Externs
+class IMaterialSystem;
+class IMaterialSystemHardwareConfig;
+
+class CBaseClientRenderTargets : public IClientRenderTargets
+{
+ // no networked vars
+ DECLARE_CLASS_GAMEROOT( CBaseClientRenderTargets, IClientRenderTargets );
+public:
+ // Interface called by engine during material system startup.
+ virtual void InitClientRenderTargets ( IMaterialSystem* pMaterialSystem, IMaterialSystemHardwareConfig* pHardwareConfig, int iWaterTextureSize = 1024, int iCameraTextureSize = 256 );
+ // Shutdown all custom render targets here.
+ virtual void ShutdownClientRenderTargets ( void );
+
+protected:
+
+ // Standard render textures used by most mods-- Classes inheriting from
+ // this can choose to init these or not depending on their needs.
+
+ // For reflective and refracting water
+ CTextureReference m_WaterReflectionTexture;
+ CTextureReference m_WaterRefractionTexture;
+
+ // Used for monitors
+ CTextureReference m_CameraTexture;
+
+ // Used for the HUD in stereo and head tracking mode
+ CTextureReference m_UITexture;
+
+ // Init functions for the common render targets
+ ITexture* CreateWaterReflectionTexture( IMaterialSystem* pMaterialSystem, int iSize = 1024 );
+ ITexture* CreateWaterRefractionTexture( IMaterialSystem* pMaterialSystem, int iSize = 1024 );
+ ITexture* CreateCameraTexture( IMaterialSystem* pMaterialSystem, int iSize = 256 );
+
+};
+
+#endif // CLIENTRENDERTARTETS_H_ \ No newline at end of file