BsD3D9RenderTexture.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. /** @addtogroup D3D9
  10. * @{
  11. */
  12. class D3D9RenderTexture;
  13. /**
  14. * DirectX 9 implementation of a render texture.
  15. *
  16. * @note Core thread only.
  17. */
  18. class BS_D3D9_EXPORT D3D9RenderTextureCore : public RenderTextureCore, public D3D9Resource
  19. {
  20. public:
  21. D3D9RenderTextureCore(const RENDER_TEXTURE_CORE_DESC& desc);
  22. virtual ~D3D9RenderTextureCore();
  23. /** @copydoc RenderTextureCore::getCustomAttribute */
  24. void getCustomAttribute(const String& name, void* data) const override;
  25. /** @copydoc D3D9Resource::notifyOnDeviceCreate */
  26. void notifyOnDeviceCreate(IDirect3DDevice9* d3d9Device) override;
  27. /** @copydoc D3D9Resource::notifyOnDeviceDestroy */
  28. void notifyOnDeviceDestroy(IDirect3DDevice9* d3d9Device) override;
  29. /** @copydoc D3D9Resource::notifyOnDeviceLost */
  30. void notifyOnDeviceLost(IDirect3DDevice9* d3d9Device) override;
  31. /** @copydoc D3D9Resource::notifyOnDeviceReset */
  32. void notifyOnDeviceReset(IDirect3DDevice9* d3d9Device) override;
  33. protected:
  34. friend class D3D9RenderTexture;
  35. /** @copydoc CoreObjectCore::initialize */
  36. void initialize() override;
  37. /** Initializes the internal color and depth surfaces. */
  38. void initializeSurfaces();
  39. /** Releases the internal color and depth surfaces. */
  40. void releaseSurfaces();
  41. /** @copydoc RenderTextureCore::getProperties */
  42. const RenderTargetProperties& getPropertiesInternal() const override { return mProperties; }
  43. IDirect3DSurface9* mDX9ColorSurface;
  44. IDirect3DSurface9* mDX9DepthStencilSurface;
  45. bool mIsBindableToShader;
  46. RenderTextureProperties mProperties;
  47. };
  48. /**
  49. * DirectX 9 implementation of a render texture.
  50. *
  51. * @note Sim thread only.
  52. */
  53. class D3D9RenderTexture : public RenderTexture
  54. {
  55. public:
  56. virtual ~D3D9RenderTexture() { }
  57. protected:
  58. friend class D3D9TextureManager;
  59. D3D9RenderTexture(const RENDER_TEXTURE_DESC& desc);
  60. /** @copydoc RenderTexture::getProperties */
  61. const RenderTargetProperties& getPropertiesInternal() const override { return mProperties; }
  62. RenderTextureProperties mProperties;
  63. };
  64. /** @} */
  65. }