BsD3D11RenderTexture.cpp 1.2 KB

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