CmD3D11TextureManager.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "CmD3D11TextureManager.h"
  2. #include "CmD3D11Texture.h"
  3. #include "CmD3D11RenderTexture.h"
  4. #include "CmD3D11Mappings.h"
  5. #include "CmD3D11RenderSystem.h"
  6. #include "CmD3D11MultiRenderTexture.h"
  7. namespace CamelotFramework
  8. {
  9. D3D11TextureManager::D3D11TextureManager()
  10. :TextureManager()
  11. { }
  12. D3D11TextureManager::~D3D11TextureManager()
  13. { }
  14. TexturePtr D3D11TextureManager::createTextureImpl()
  15. {
  16. D3D11Texture* tex = new (cm_alloc<D3D11Texture, PoolAlloc>()) D3D11Texture();
  17. return cm_core_ptr<D3D11Texture, PoolAlloc>(tex);
  18. }
  19. RenderTexturePtr D3D11TextureManager::createRenderTextureImpl()
  20. {
  21. D3D11RenderTexture* tex = new (cm_alloc<D3D11RenderTexture, PoolAlloc>()) D3D11RenderTexture();
  22. return cm_core_ptr<D3D11RenderTexture, PoolAlloc>(tex);
  23. }
  24. MultiRenderTexturePtr D3D11TextureManager::createMultiRenderTextureImpl()
  25. {
  26. D3D11MultiRenderTexture* tex = new (cm_alloc<D3D11MultiRenderTexture, PoolAlloc>()) D3D11MultiRenderTexture();
  27. return cm_core_ptr<D3D11MultiRenderTexture, PoolAlloc>(tex);
  28. }
  29. PixelFormat D3D11TextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage)
  30. {
  31. // Basic filtering
  32. DXGI_FORMAT d3dPF = D3D11Mappings::_getPF(D3D11Mappings::_getClosestSupportedPF(format));
  33. return D3D11Mappings::_getPF(d3dPF);
  34. }
  35. }