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.

140 lines
3.8 KiB

  1. //========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Header: $
  6. // $NoKeywords: $
  7. //
  8. //=============================================================================//
  9. #ifndef MATERIALSYSTEM_GLOBAL_H
  10. #define MATERIALSYSTEM_GLOBAL_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "imaterialsysteminternal.h"
  15. #include "tier0/dbg.h"
  16. #include "tier2/tier2.h"
  17. #if defined( _PS3 ) || defined( _OSX )
  18. #include "shaderapidx9/shaderapidx8.h"
  19. #include "shaderapidx9/shaderdevicedx8.h"
  20. #include "shaderapidx9/hardwareconfig.h"
  21. #include "shaderapidx9/shaderapidx8_global.h"
  22. #include "shaderapidx9/shadershadowdx8.h"
  23. #endif
  24. #if defined( INCLUDE_SCALEFORM )
  25. #include "scaleformui/scaleformui.h"
  26. #endif
  27. //-----------------------------------------------------------------------------
  28. // Forward declarations
  29. //-----------------------------------------------------------------------------
  30. class ITextureInternal;
  31. class IShaderAPI;
  32. class IHardwareConfigInternal;
  33. class IShaderUtil;
  34. class IShaderShadow;
  35. class IShaderDeviceMgr;
  36. class IShaderDevice;
  37. class IShaderSystemInternal;
  38. class IMaterialInternal;
  39. class IColorCorrectionSystem;
  40. class IMaterialVar;
  41. class IClientMaterialSystem;
  42. //-----------------------------------------------------------------------------
  43. // Constants used by the system
  44. //-----------------------------------------------------------------------------
  45. #define MATERIAL_MAX_PATH 256
  46. // GR - limits for blured image (HDR stuff)
  47. #define MAX_BLUR_IMAGE_WIDTH 256
  48. #define MAX_BLUR_IMAGE_HEIGHT 192
  49. #define CLAMP_BLUR_IMAGE_WIDTH( _w ) ( ( _w < MAX_BLUR_IMAGE_WIDTH ) ? _w : MAX_BLUR_IMAGE_WIDTH )
  50. #define CLAMP_BLUR_IMAGE_HEIGHT( _h ) ( ( _h < MAX_BLUR_IMAGE_HEIGHT ) ? _h : MAX_BLUR_IMAGE_HEIGHT )
  51. //-----------------------------------------------------------------------------
  52. // Global structures
  53. //-----------------------------------------------------------------------------
  54. extern MaterialSystem_Config_t g_config;
  55. extern uint32 g_nDebugVarsSignature;
  56. //extern MaterialSystem_ErrorFunc_t Error;
  57. //extern MaterialSystem_WarningFunc_t Warning;
  58. extern int g_FrameNum;
  59. #ifndef SHADERAPI_GLOBAL_H
  60. extern IShaderAPI* g_pShaderAPI;
  61. extern IShaderDeviceMgr* g_pShaderDeviceMgr;
  62. extern IShaderDevice* g_pShaderDevice;
  63. extern IShaderShadow* g_pShaderShadow;
  64. #endif
  65. extern IClientMaterialSystem *g_pClientMaterialSystem;
  66. extern IMaterialInternal *g_pErrorMaterial;
  67. IShaderSystemInternal* ShaderSystem();
  68. inline IShaderSystemInternal* ShaderSystem()
  69. {
  70. extern IShaderSystemInternal *g_pShaderSystem;
  71. return g_pShaderSystem;
  72. }
  73. #ifdef _PS3
  74. #include "shaderapidx9/hardwareconfig_ps3nonvirt.h"
  75. #elif !defined( _OSX )
  76. inline IHardwareConfigInternal *HardwareConfig()
  77. {
  78. extern IHardwareConfigInternal* g_pHWConfig;
  79. return g_pHWConfig;
  80. }
  81. #endif
  82. #if defined( INCLUDE_SCALEFORM )
  83. inline IScaleformUI* ScaleformUI()
  84. {
  85. extern IScaleformUI* g_pScaleformUI;
  86. return g_pScaleformUI;
  87. }
  88. #endif
  89. //-----------------------------------------------------------------------------
  90. // Accessor to get at the material system
  91. //-----------------------------------------------------------------------------
  92. inline IMaterialSystemInternal* MaterialSystem()
  93. {
  94. extern IMaterialSystemInternal *g_pInternalMaterialSystem;
  95. return g_pInternalMaterialSystem;
  96. }
  97. #ifndef SHADERAPI_GLOBAL_H
  98. inline IShaderUtil* ShaderUtil()
  99. {
  100. extern IShaderUtil *g_pShaderUtil;
  101. return g_pShaderUtil;
  102. }
  103. #endif
  104. extern IColorCorrectionSystem *g_pColorCorrectionSystem;
  105. inline IColorCorrectionSystem *ColorCorrectionSystem()
  106. {
  107. return g_pColorCorrectionSystem;
  108. }
  109. //-----------------------------------------------------------------------------
  110. // Global methods related to material vars
  111. //-----------------------------------------------------------------------------
  112. void EnableThreadedMaterialVarAccess( bool bEnable, IMaterialVar **ppParams, int nVarCount );
  113. #endif // MATERIALSYSTEM_GLOBAL_H