BsD3D11RenderTexture.cpp 965 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "BsD3D11RenderTexture.h"
  2. #include "BsD3D11RenderSystem.h"
  3. #include "BsD3D11Device.h"
  4. #include "BsD3D11Texture.h"
  5. #include "BsD3D11Mappings.h"
  6. #include "BsD3D11TextureView.h"
  7. #include "BsTextureManager.h"
  8. #include "BsException.h"
  9. namespace BansheeEngine
  10. {
  11. D3D11RenderTexture::D3D11RenderTexture()
  12. :RenderTexture()
  13. {
  14. }
  15. D3D11RenderTexture::~D3D11RenderTexture()
  16. {
  17. }
  18. void D3D11RenderTexture::getCustomAttribute(const String& name, void* pData) const
  19. {
  20. if(name == "RTV")
  21. {
  22. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  23. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurface.get());
  24. *pRTVs = textureView->getRTV();
  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. }