BsD3D11Prerequisites.h 3.0 KB

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