Team Fortress 2 Source Code as on 22/4/2020
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.

100 lines
2.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef SHADERAPIDX8_GLOBAL_H
  9. #define SHADERAPIDX8_GLOBAL_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "tier0/dbg.h"
  14. #include "tier0/memalloc.h"
  15. #include "shaderapi_global.h"
  16. #include "tier2/tier2.h"
  17. #include "shaderdevicedx8.h"
  18. //-----------------------------------------------------------------------------
  19. // Use this to fill in structures with the current board state
  20. //-----------------------------------------------------------------------------
  21. #ifdef _DEBUG
  22. #define DEBUG_BOARD_STATE 0
  23. #endif
  24. #if !defined( _X360 )
  25. IDirect3DDevice9 *Dx9Device();
  26. IDirect3D9 *D3D();
  27. #endif
  28. //-----------------------------------------------------------------------------
  29. // Measures driver allocations
  30. //-----------------------------------------------------------------------------
  31. //#define MEASURE_DRIVER_ALLOCATIONS 1
  32. //-----------------------------------------------------------------------------
  33. // Forward declarations
  34. //-----------------------------------------------------------------------------
  35. class IShaderUtil;
  36. class IVertexBufferDX8;
  37. class IShaderShadowDX8;
  38. class IMeshMgr;
  39. class IShaderAPIDX8;
  40. class IFileSystem;
  41. class IShaderManager;
  42. //-----------------------------------------------------------------------------
  43. // A new shader draw flag we need to workaround dx8
  44. //-----------------------------------------------------------------------------
  45. enum
  46. {
  47. SHADER_HAS_CONSTANT_COLOR = 0x80000000
  48. };
  49. //-----------------------------------------------------------------------------
  50. // The main shader API
  51. //-----------------------------------------------------------------------------
  52. extern IShaderAPIDX8 *g_pShaderAPIDX8;
  53. inline IShaderAPIDX8* ShaderAPI()
  54. {
  55. return g_pShaderAPIDX8;
  56. }
  57. //-----------------------------------------------------------------------------
  58. // The shader shadow
  59. //-----------------------------------------------------------------------------
  60. IShaderShadowDX8* ShaderShadow();
  61. //-----------------------------------------------------------------------------
  62. // Manager of all vertex + pixel shaders
  63. //-----------------------------------------------------------------------------
  64. inline IShaderManager *ShaderManager()
  65. {
  66. extern IShaderManager *g_pShaderManager;
  67. return g_pShaderManager;
  68. }
  69. //-----------------------------------------------------------------------------
  70. // The mesh manager
  71. //-----------------------------------------------------------------------------
  72. IMeshMgr* MeshMgr();
  73. //-----------------------------------------------------------------------------
  74. // The main hardware config interface
  75. //-----------------------------------------------------------------------------
  76. inline IMaterialSystemHardwareConfig* HardwareConfig()
  77. {
  78. return g_pMaterialSystemHardwareConfig;
  79. }
  80. #endif // SHADERAPIDX8_GLOBAL_H