BsD3D11MultiRenderTexture.cpp 1.4 KB

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