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 /materialsystem/materialsystem_global.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'materialsystem/materialsystem_global.h')
| -rw-r--r-- | materialsystem/materialsystem_global.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/materialsystem/materialsystem_global.h b/materialsystem/materialsystem_global.h new file mode 100644 index 0000000..bed23a7 --- /dev/null +++ b/materialsystem/materialsystem_global.h @@ -0,0 +1,110 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Header: $ +// $NoKeywords: $ +// +//=============================================================================// + +#ifndef MATERIALSYSTEM_GLOBAL_H +#define MATERIALSYSTEM_GLOBAL_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "imaterialsysteminternal.h" +#include "tier0/dbg.h" +#include "tier2/tier2.h" + + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +class ITextureInternal; +class IShaderAPI; +class IHardwareConfigInternal; +class IShaderUtil; +class IShaderShadow; +class IShaderDeviceMgr; +class IShaderDevice; +class IShaderSystemInternal; +class IMaterialInternal; +class IColorCorrectionSystem; +class IMaterialVar; + + +//----------------------------------------------------------------------------- +// Constants used by the system +//----------------------------------------------------------------------------- + +#define MATERIAL_MAX_PATH 256 + +// GR - limits for blured image (HDR stuff) +#define MAX_BLUR_IMAGE_WIDTH 256 +#define MAX_BLUR_IMAGE_HEIGHT 192 + +#define CLAMP_BLUR_IMAGE_WIDTH( _w ) ( ( _w < MAX_BLUR_IMAGE_WIDTH ) ? _w : MAX_BLUR_IMAGE_WIDTH ) +#define CLAMP_BLUR_IMAGE_HEIGHT( _h ) ( ( _h < MAX_BLUR_IMAGE_HEIGHT ) ? _h : MAX_BLUR_IMAGE_HEIGHT ) + +//----------------------------------------------------------------------------- +// Global structures +//----------------------------------------------------------------------------- +extern MaterialSystem_Config_t g_config; +extern uint32 g_nDebugVarsSignature; + +//extern MaterialSystem_ErrorFunc_t Error; +//extern MaterialSystem_WarningFunc_t Warning; + +extern int g_FrameNum; + +extern IShaderAPI* g_pShaderAPI; +extern IShaderDeviceMgr* g_pShaderDeviceMgr; +extern IShaderDevice* g_pShaderDevice; +extern IShaderShadow* g_pShaderShadow; + +extern IMaterialInternal *g_pErrorMaterial; + +IShaderSystemInternal* ShaderSystem(); +inline IShaderSystemInternal* ShaderSystem() +{ + extern IShaderSystemInternal *g_pShaderSystem; + return g_pShaderSystem; +} + +inline IHardwareConfigInternal *HardwareConfig() +{ + extern IHardwareConfigInternal* g_pHWConfig; + return g_pHWConfig; +} + +//----------------------------------------------------------------------------- +// Accessor to get at the material system +//----------------------------------------------------------------------------- +inline IMaterialSystemInternal* MaterialSystem() +{ + extern IMaterialSystemInternal *g_pInternalMaterialSystem; + return g_pInternalMaterialSystem; +} + +inline IShaderUtil* ShaderUtil() +{ + extern IShaderUtil *g_pShaderUtil; + return g_pShaderUtil; +} + +extern IColorCorrectionSystem *g_pColorCorrectionSystem; +inline IColorCorrectionSystem *ColorCorrectionSystem() +{ + return g_pColorCorrectionSystem; +} + + +//----------------------------------------------------------------------------- +// Global methods related to material vars +//----------------------------------------------------------------------------- +void EnableThreadedMaterialVarAccess( bool bEnable, IMaterialVar **ppParams, int nVarCount ); + + +#endif // MATERIALSYSTEM_GLOBAL_H |