BsD3D9Prerequisites.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #define D3D9_DEVICE_ACCESS_LOCK
  4. #define D3D9_DEVICE_ACCESS_UNLOCK
  5. #define D3D9_DEVICE_ACCESS_CRITICAL_SECTION
  6. #define DIRECT3D_VERSION 0x0900
  7. #define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
  8. #if BS_DEBUG_MODE
  9. # define D3D_DEBUG_INFO
  10. #endif
  11. #define WIN32_LEAN_AND_MEAN
  12. #if !defined(NOMINMAX) && defined(_MSC_VER)
  13. # define NOMINMAX // required to stop windows.h messing up std::min
  14. #endif
  15. #include <d3d9.h>
  16. #include <d3dx9.h>
  17. #include <DxErr.h>
  18. namespace BansheeEngine
  19. {
  20. // Predefine classes
  21. class D3D9RenderSystem;
  22. class D3D9RenderWindow;
  23. class D3D9Texture;
  24. class D3D9TextureManager;
  25. class D3D9Driver;
  26. class D3D9DriverList;
  27. class D3D9VideoMode;
  28. class D3D9VideoModeList;
  29. class D3D9Device;
  30. class D3D9DeviceManager;
  31. class D3D9ResourceManager;
  32. class D3D9GpuProgram;
  33. class D3D9GpuProgramManager;
  34. class D3D9HardwareBufferManager;
  35. class D3D9IndexBuffer;
  36. class D3D9HLSLProgramFactory;
  37. class D3D9HLSLProgram;
  38. class D3D9VertexDeclaration;
  39. class D3D9Resource;
  40. typedef std::shared_ptr<D3D9RenderWindow> D3D9RenderWindowPtr;
  41. typedef std::shared_ptr<D3D9Texture> D3D9TexturePtr;
  42. /**
  43. * @brief Type IDs used for RTTI.
  44. */
  45. enum TypeID_D3D9
  46. {
  47. TID_D3D9_GpuProgram = 10000,
  48. TID_D3D9_GpuVertexProgram = 10001,
  49. TID_D3D9_GpuFragmentProgram = 10002
  50. };
  51. /**
  52. * @brief DirectX 9 specific types to track resource statistics for.
  53. */
  54. enum D3D9RenderStatResourceType
  55. {
  56. RenderStatObject_VertexDeclaration = 100
  57. };
  58. #if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(BS_STATIC_LIB)
  59. # ifdef BS_RSD3D9_EXPORTS
  60. # define BS_D3D9_EXPORT __declspec(dllexport)
  61. # else
  62. # if defined( __MINGW32__ )
  63. # define BS_D3D9_EXPORT
  64. # else
  65. # define BS_D3D9_EXPORT __declspec(dllimport)
  66. # endif
  67. # endif
  68. #else
  69. # define BS_D3D9_EXPORT
  70. #endif
  71. }