CmD3D11MultiRenderTexture.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "CmD3D11MultiRenderTexture.h"
  2. #include "CmD3D11Texture.h"
  3. #include "CmD3D11RenderTexture.h"
  4. #include "CmD3D11TextureView.h"
  5. namespace CamelotEngine
  6. {
  7. D3D11MultiRenderTexture::D3D11MultiRenderTexture()
  8. :MultiRenderTexture()
  9. {
  10. }
  11. D3D11MultiRenderTexture::~D3D11MultiRenderTexture()
  12. {
  13. }
  14. void D3D11MultiRenderTexture::destroy_internal()
  15. {
  16. MultiRenderTexture::destroy_internal();
  17. }
  18. void D3D11MultiRenderTexture::setColorSurfaceImpl(UINT32 surfaceIdx, TexturePtr texture, UINT32 face, UINT32 numFaces, UINT32 mipLevel)
  19. { }
  20. void D3D11MultiRenderTexture::setDepthStencilImpl(TexturePtr depthStencilSurface, UINT32 face, UINT32 numFaces, UINT32 mipLevel)
  21. { }
  22. void D3D11MultiRenderTexture::getCustomAttribute(const String& name, void* pData)
  23. {
  24. if(name == "RTV")
  25. {
  26. ID3D11RenderTargetView** pRTVs = (ID3D11RenderTargetView **)pData;
  27. for(size_t x = 0; x < mColorSurfaces.size(); ++x)
  28. {
  29. D3D11TextureView* textureView = static_cast<D3D11TextureView*>(mColorSurfaces[x]);
  30. pRTVs[x] = textureView->getRTV();
  31. }
  32. return;
  33. }
  34. else if(name == "DSV")
  35. {
  36. ID3D11DepthStencilView** pDSV = (ID3D11DepthStencilView **)pData;
  37. D3D11TextureView* depthStencilView = static_cast<D3D11TextureView*>(mDepthStencilSurface);
  38. *pDSV = depthStencilView->getDSV();
  39. return;
  40. }
  41. }
  42. }