BsD3D11RenderTexture.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "BsD3D11RenderTexture.h"
  4. #include "BsD3D11TextureView.h"
  5. namespace BansheeEngine
  6. {
  7. D3D11RenderTextureCore::D3D11RenderTextureCore(const RENDER_TEXTURE_CORE_DESC& desc)
  8. :RenderTextureCore(desc), mProperties(desc, false)
  9. {
  10. }
  11. void D3D11RenderTextureCore::getCustomAttribute(const String& name, void* pData) const
  12. {
  13. if(name == "RTV")
  14. {
  15. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  16. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurface.get());
  17. *pRTVs = textureView->getRTV();
  18. return;
  19. }
  20. else if(name == "DSV")
  21. {
  22. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  23. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface.get());
  24. *pDSV = depthStencilView->getDSV(false);
  25. return;
  26. }
  27. else if (name == "RODSV")
  28. {
  29. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  30. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface.get());
  31. *pDSV = depthStencilView->getDSV(true);
  32. return;
  33. }
  34. }
  35. D3D11RenderTexture::D3D11RenderTexture(const RENDER_TEXTURE_DESC& desc)
  36. :RenderTexture(desc), mProperties(desc, false)
  37. {
  38. }
  39. }