BsD3D11RenderTexture.cpp 1.1 KB

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