BsD3D9RenderTexture.h 2.5 KB

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