BsD3D11Prerequisites.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
  4. #if BS_DEBUG_MODE
  5. # define D3D_DEBUG_INFO
  6. #endif
  7. #define WIN32_LEAN_AND_MEAN
  8. #if !defined(NOMINMAX) && defined(_MSC_VER)
  9. # define NOMINMAX // Required to stop windows.h messing up std::min
  10. #endif
  11. #include <d3d11.h>
  12. #include <d3d11shader.h>
  13. #include <D3Dcompiler.h>
  14. namespace BansheeEngine
  15. {
  16. class D3D11RenderAPI;
  17. class D3D11RenderWindow;
  18. class D3D11Texture;
  19. class D3D11TextureManager;
  20. class D3D11DepthBuffer;
  21. class D3D11Driver;
  22. class D3D11DriverList;
  23. class D3D11VideoMode;
  24. class D3D11VideoModeList;
  25. class D3D11GpuProgramManager;
  26. class D3D11IndexBuffer;
  27. class D3D11HardwareConstantBuffer;
  28. class D3D11HLSLProgramFactory;
  29. class D3D11HLSLProgram;
  30. class D3D11VertexDeclaration;
  31. class D3D11Device;
  32. class D3D11HardwareBuffer;
  33. class D3D11GpuVertexProgram;
  34. class D3D11GpuFragmentProgram;
  35. class D3D11GpuGeometryProgram;
  36. class D3D11GpuHullProgram;
  37. class D3D11GpuDomainProgram;
  38. class D3D11BlendState;
  39. class D3D11RasterizerState;
  40. class D3D11SamplerState;
  41. class D3D11DepthStencilState;
  42. class D3D11InputLayoutManager;
  43. class D3D11GpuBufferCore;
  44. class D3D11RenderUtility;
  45. class D3D11GpuProgramCore;
  46. /**
  47. * @brief DirectX 11 specific types to track resource statistics for.
  48. */
  49. enum D3D11RenderStatResourceType
  50. {
  51. RenderStatObject_DepthStencilState = 100,
  52. RenderStatObject_RasterizerState,
  53. RenderStatObject_BlendState,
  54. RenderStatObject_SamplerState,
  55. RenderStatObject_InputLayout,
  56. RenderStatObject_ResourceView,
  57. RenderStatObject_SwapChain
  58. };
  59. typedef Vector<char*> HLSLMicroCode;
  60. typedef std::shared_ptr<D3D11GpuVertexProgram> D3D11GpuVertexProgramPtr;
  61. typedef std::shared_ptr<D3D11GpuFragmentProgram> D3D11GpuFragmentProgramPtr;
  62. typedef std::shared_ptr<D3D11GpuGeometryProgram> D3D11GpuGeometryProgramPtr;
  63. typedef std::shared_ptr<D3D11GpuHullProgram> D3D11GpuHullProgramPtr;
  64. typedef std::shared_ptr<D3D11GpuDomainProgram> D3D11GpuDomainProgramPtr;
  65. typedef std::shared_ptr<D3D11BlendState> D3D11BlendStatePtr;
  66. typedef std::shared_ptr<D3D11RasterizerState> D3D11RasterizerStatePtr;
  67. typedef std::shared_ptr<D3D11SamplerState> D3D11SamplerStatePtr;
  68. typedef std::shared_ptr<D3D11DepthStencilState> D3D11DepthStencilStatePtr;
  69. typedef std::shared_ptr<D3D11RenderWindow> D3D11RenderWindowPtr;
  70. #if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(BS_STATIC_LIB)
  71. # ifdef BS_RSD3D11_EXPORTS
  72. # define BS_D3D11_EXPORT __declspec(dllexport)
  73. # else
  74. # if defined( __MINGW32__ )
  75. # define BS_D3D11_EXPORT
  76. # else
  77. # define BS_D3D11_EXPORT __declspec(dllimport)
  78. # endif
  79. # endif
  80. #else
  81. # define BS_D3D11_EXPORT
  82. #endif
  83. }