CmMultiRenderTexture.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmRenderTarget.h"
  4. namespace CamelotEngine
  5. {
  6. class CM_EXPORT MultiRenderTexture : public RenderTarget
  7. {
  8. public:
  9. virtual ~MultiRenderTexture() {}
  10. void setColorSurface(UINT32 surfaceIdx, TexturePtr texture, UINT32 face = 0, UINT32 numFaces = 0, UINT32 mipLevel = 0);
  11. void setDepthStencil(DepthStencilBufferPtr depthStencilbuffer);
  12. SurfaceDesc getSurfaceDesc(UINT32 surfaceIdx) const { return mSurfaces.at(surfaceIdx); }
  13. DepthStencilBufferPtr getDepthStencilBuffer() const { return mDepthStencilBuffer; }
  14. bool requiresTextureFlipping() const { return false; }
  15. protected:
  16. vector<SurfaceDesc>::type mSurfaces;
  17. DepthStencilBufferPtr mDepthStencilBuffer;
  18. MultiRenderTexture();
  19. virtual void initialize() {}
  20. virtual void setColorSurfaceImpl(UINT32 surfaceIdx, TexturePtr texture, UINT32 face = 0, UINT32 numFaces = 0, UINT32 mipLevel = 0) = 0;
  21. virtual void setDepthStencilImpl(DepthStencilBufferPtr depthStencilbuffer) = 0;
  22. private:
  23. void throwIfBuffersDontMatch() const;
  24. virtual void copyContentsToMemory(const PixelData &dst, FrameBuffer buffer = FB_AUTO);
  25. };
  26. }