BsD3D11RenderTexture.cpp 1.1 KB

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. D3D11RenderTextureCore::D3D11RenderTextureCore(const RENDER_TEXTURE_DESC& desc)
  12. :RenderTextureCore(desc), mProperties(desc, false)
  13. { }
  14. void D3D11RenderTextureCore::getCustomAttribute(const String& name, void* pData) const
  15. {
  16. if(name == "RTV")
  17. {
  18. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  19. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurface.get());
  20. *pRTVs = textureView->getRTV();
  21. return;
  22. }
  23. else if(name == "DSV")
  24. {
  25. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  26. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface.get());
  27. *pDSV = depthStencilView->getDSV();
  28. return;
  29. }
  30. }
  31. D3D11RenderTexture::D3D11RenderTexture(const RENDER_TEXTURE_DESC& desc)
  32. :RenderTexture(desc), mProperties(desc, false)
  33. {
  34. }
  35. }