BsD3D9RenderTexture.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #pragma once
  2. #include "BsD3D9Prerequisites.h"
  3. #include "BsD3D9Resource.h"
  4. #include "BsRenderTexture.h"
  5. namespace BansheeEngine
  6. {
  7. class D3D9RenderTexture;
  8. /**
  9. * @brief DirectX 9 implementation of a render texture.
  10. *
  11. * @note Core thread only.
  12. */
  13. class BS_D3D9_EXPORT D3D9RenderTextureCore : public RenderTextureCore, public D3D9Resource
  14. {
  15. public:
  16. D3D9RenderTextureCore(const RENDER_TEXTURE_CORE_DESC& desc);
  17. virtual ~D3D9RenderTextureCore();
  18. /**
  19. * @copydoc RenderTextureCore::getCustomAttribute
  20. */
  21. virtual void getCustomAttribute(const String& name, void* pData) const;
  22. /**
  23. * @copydoc D3D9Resource::notifyOnDeviceCreate
  24. */
  25. virtual void notifyOnDeviceCreate(IDirect3DDevice9* d3d9Device);
  26. /**
  27. * @copydoc D3D9Resource::notifyOnDeviceDestroy
  28. */
  29. virtual void notifyOnDeviceDestroy(IDirect3DDevice9* d3d9Device);
  30. /**
  31. * @copydoc D3D9Resource::notifyOnDeviceLost
  32. */
  33. virtual void notifyOnDeviceLost(IDirect3DDevice9* d3d9Device);
  34. /**
  35. * @copydoc D3D9Resource::notifyOnDeviceReset
  36. */
  37. virtual void notifyOnDeviceReset(IDirect3DDevice9* d3d9Device);
  38. protected:
  39. friend class D3D9RenderTexture;
  40. /**
  41. * @copydoc CoreObjectCore::initialize
  42. */
  43. virtual void initialize();
  44. /**
  45. * @brief Initializes the internal color and depth surfaces.
  46. */
  47. void initializeSurfaces();
  48. /**
  49. * @brief Releases the internal color and depth surfaces.
  50. */
  51. void releaseSurfaces();
  52. /**
  53. * @copydoc RenderTextureCore::getProperties
  54. */
  55. const RenderTargetProperties& getPropertiesInternal() const { return mProperties; }
  56. protected:
  57. IDirect3DSurface9* mDX9ColorSurface;
  58. IDirect3DSurface9* mDX9DepthStencilSurface;
  59. bool mIsBindableToShader;
  60. RenderTextureProperties mProperties;
  61. };
  62. /**
  63. * @brief DirectX 9 implementation of a render texture.
  64. *
  65. * @note Sim thread only.
  66. */
  67. class D3D9RenderTexture : public RenderTexture
  68. {
  69. public:
  70. virtual ~D3D9RenderTexture() { }
  71. protected:
  72. friend class D3D9TextureManager;
  73. D3D9RenderTexture(const RENDER_TEXTURE_DESC& desc);
  74. /**
  75. * @copydoc RenderTexture::getProperties
  76. */
  77. const RenderTargetProperties& getPropertiesInternal() const { return mProperties; }
  78. RenderTextureProperties mProperties;
  79. };
  80. }