BsMultiRenderTexture.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsRenderTarget.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Descriptor class used for initializing a MultiRenderTexture.
  8. * Contains descriptors for each individual color render surface and
  9. * their common depth/stencil surface.
  10. */
  11. struct BS_CORE_EXPORT MULTI_RENDER_TEXTURE_DESC
  12. {
  13. Vector<RENDER_SURFACE_DESC> colorSurfaces;
  14. RENDER_SURFACE_DESC depthStencilSurface;
  15. };
  16. /**
  17. * @brief Object representing multiple render textures. You may bind this to the pipeline
  18. * in order to render to all or some of the textures at once.
  19. */
  20. class BS_CORE_EXPORT MultiRenderTexture : public RenderTarget
  21. {
  22. public:
  23. virtual ~MultiRenderTexture();
  24. /**
  25. * @copydoc RenderTarget::initialize
  26. */
  27. void initialize(const MULTI_RENDER_TEXTURE_DESC& desc);
  28. /**
  29. * @copydoc RenderTarget::isWindow.
  30. */
  31. bool isWindow() const { return true; }
  32. /**
  33. * @copydoc RenderTarget::requiresTextureFlipping.
  34. */
  35. bool requiresTextureFlipping() const { return false; }
  36. protected:
  37. MultiRenderTexture();
  38. /**
  39. * @copydoc RenderTarget::destroy_internal()
  40. */
  41. virtual void destroy_internal();
  42. private:
  43. /**
  44. * @brief Checks that all render surfaces and depth/stencil surface match. If they do not match
  45. * an exception is thrown.
  46. */
  47. void throwIfBuffersDontMatch() const;
  48. // TODO - Not implemented
  49. virtual void copyToMemory(const PixelData &dst, FrameBuffer buffer = FB_AUTO);
  50. protected:
  51. Vector<TextureViewPtr> mColorSurfaces;
  52. TextureViewPtr mDepthStencilSurface;
  53. };
  54. }