BsD3D11MultiRenderTexture.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "BsD3D11MultiRenderTexture.h"
  2. #include "BsD3D11Texture.h"
  3. #include "BsD3D11RenderTexture.h"
  4. #include "BsD3D11TextureView.h"
  5. namespace BansheeEngine
  6. {
  7. D3D11MultiRenderTextureCore::D3D11MultiRenderTextureCore(const MULTI_RENDER_TEXTURE_DESC& desc)
  8. :MultiRenderTextureCore(desc), mProperties(desc)
  9. {
  10. }
  11. D3D11MultiRenderTextureCore::~D3D11MultiRenderTextureCore()
  12. {
  13. }
  14. void D3D11MultiRenderTextureCore::getCustomAttribute(const String& name, void* pData) const
  15. {
  16. if(name == "RTV")
  17. {
  18. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  19. for(size_t x = 0; x < mColorSurfaces.size(); ++x)
  20. {
  21. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurfaces[x].get());
  22. pRTVs[x] = textureView->getRTV();
  23. }
  24. return;
  25. }
  26. else if(name == "DSV")
  27. {
  28. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  29. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface.get());
  30. *pDSV = depthStencilView->getDSV();
  31. return;
  32. }
  33. }
  34. D3D11MultiRenderTexture::D3D11MultiRenderTexture(const MULTI_RENDER_TEXTURE_DESC& desc)
  35. :MultiRenderTexture(desc), mProperties(desc)
  36. { }
  37. }