CmD3D11RenderTexture.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "CmD3D11RenderTexture.h"
  2. #include "CmD3D11RenderSystem.h"
  3. #include "CmD3D11Device.h"
  4. #include "CmD3D11Texture.h"
  5. #include "CmD3D11Mappings.h"
  6. #include "CmD3D11TextureView.h"
  7. #include "CmTextureManager.h"
  8. #include "CmException.h"
  9. namespace CamelotFramework
  10. {
  11. D3D11RenderTexture::D3D11RenderTexture()
  12. :RenderTexture()
  13. {
  14. }
  15. D3D11RenderTexture::~D3D11RenderTexture()
  16. {
  17. }
  18. void D3D11RenderTexture::initialize_internal()
  19. {
  20. // Do nothing
  21. }
  22. void D3D11RenderTexture::getCustomAttribute(const String& name, void* pData) const
  23. {
  24. if(name == "RTV")
  25. {
  26. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  27. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurface.get());
  28. *pRTVs = textureView->getRTV();
  29. return;
  30. }
  31. else if(name == "DSV")
  32. {
  33. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  34. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface.get());
  35. *pDSV = depthStencilView->getDSV();
  36. return;
  37. }
  38. }
  39. }