BsD3D9RenderTexture.h 2.4 KB

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