BsD3D11MultiRenderTexture.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #include "BsD3D11MultiRenderTexture.h"
  5. #include "BsD3D11Texture.h"
  6. #include "BsD3D11RenderTexture.h"
  7. #include "BsD3D11TextureView.h"
  8. namespace BansheeEngine
  9. {
  10. D3D11MultiRenderTexture::D3D11MultiRenderTexture()
  11. :MultiRenderTexture()
  12. {
  13. }
  14. D3D11MultiRenderTexture::~D3D11MultiRenderTexture()
  15. {
  16. }
  17. void D3D11MultiRenderTexture::getCustomAttribute(const String& name, void* pData) const
  18. {
  19. if(name == "RTV")
  20. {
  21. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  22. for(size_t x = 0; x < mColorSurfaces.size(); ++x)
  23. {
  24. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurfaces[x].get());
  25. pRTVs[x] = textureView->getRTV();
  26. }
  27. return;
  28. }
  29. else if(name == "DSV")
  30. {
  31. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  32. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface.get());
  33. *pDSV = depthStencilView->getDSV();
  34. return;
  35. }
  36. }
  37. }