BsD3D11RenderTexture.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #include "BsD3D11RenderTexture.h"
  5. #include "BsD3D11RenderSystem.h"
  6. #include "BsD3D11Device.h"
  7. #include "BsD3D11Texture.h"
  8. #include "BsD3D11Mappings.h"
  9. #include "BsD3D11TextureView.h"
  10. #include "BsTextureManager.h"
  11. #include "BsException.h"
  12. namespace BansheeEngine
  13. {
  14. D3D11RenderTexture::D3D11RenderTexture()
  15. :RenderTexture()
  16. {
  17. }
  18. D3D11RenderTexture::~D3D11RenderTexture()
  19. {
  20. }
  21. void D3D11RenderTexture::getCustomAttribute(const String& name, void* pData) const
  22. {
  23. if(name == "RTV")
  24. {
  25. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  26. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurface.get());
  27. *pRTVs = textureView->getRTV();
  28. return;
  29. }
  30. else if(name == "DSV")
  31. {
  32. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  33. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface.get());
  34. *pDSV = depthStencilView->getDSV();
  35. return;
  36. }
  37. }
  38. }