CmD3D11RenderTexture.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 CamelotEngine
  10. {
  11. D3D11RenderTexture::D3D11RenderTexture()
  12. :RenderTexture()
  13. {
  14. }
  15. D3D11RenderTexture::~D3D11RenderTexture()
  16. {
  17. }
  18. void D3D11RenderTexture::destroy_internal()
  19. {
  20. RenderTexture::destroy_internal();
  21. }
  22. void D3D11RenderTexture::createInternalResourcesImpl()
  23. {
  24. // Do nothing
  25. }
  26. void D3D11RenderTexture::getCustomAttribute(const String& name, void* pData)
  27. {
  28. if(name == "RTV")
  29. {
  30. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  31. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurface);
  32. *pRTVs = textureView->getRTV();
  33. return;
  34. }
  35. else if(name == "DSV")
  36. {
  37. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  38. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface);
  39. *pDSV = depthStencilView->getDSV();
  40. return;
  41. }
  42. }
  43. }