BsD3D9RenderTexture.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #pragma once
  2. #include "BsD3D9Prerequisites.h"
  3. #include "BsD3D9Resource.h"
  4. #include "BsRenderTexture.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief DirectX 9 implementation of a render texture.
  9. */
  10. class BS_D3D9_EXPORT D3D9RenderTexture : public RenderTexture, public D3D9Resource
  11. {
  12. public:
  13. virtual ~D3D9RenderTexture();
  14. /**
  15. * @copydoc RenderTexture::requiresTextureFlipping
  16. */
  17. virtual bool requiresTextureFlipping() const { return false; }
  18. /**
  19. * @copydoc RenderTexture::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 D3D9TextureManager;
  40. D3D9RenderTexture();
  41. /**
  42. * @copydoc RenderTexture::initialize_internal().
  43. */
  44. void initialize_internal();
  45. /**
  46. * @brief Initializes the internal color and depth surfaces.
  47. */
  48. void initializeSurfaces();
  49. /**
  50. * @brief Releases the internal color and depth surfaces.
  51. */
  52. void releaseSurfaces();
  53. protected:
  54. IDirect3DSurface9* mDX9ColorSurface;
  55. IDirect3DSurface9* mDX9DepthStencilSurface;
  56. bool mIsBindableToShader;
  57. };
  58. }