BsMultiRenderTexture.h 1.9 KB

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