BsD3D11RenderStateManager.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "BsD3D11RenderStateManager.h"
  4. #include "BsD3D11SamplerState.h"
  5. #include "BsD3D11DepthStencilState.h"
  6. #include "BsD3D11RasterizerState.h"
  7. #include "BsD3D11BlendState.h"
  8. namespace bs { namespace ct
  9. {
  10. SPtr<SamplerState> D3D11RenderStateManager::createSamplerStateInternal(const SAMPLER_STATE_DESC& desc, GpuDeviceFlags deviceMask) const
  11. {
  12. SPtr<SamplerState> ret = bs_shared_ptr<D3D11SamplerState>(new (bs_alloc<D3D11SamplerState>()) D3D11SamplerState(desc, deviceMask));
  13. ret->_setThisPtr(ret);
  14. return ret;
  15. }
  16. SPtr<BlendState> D3D11RenderStateManager::createBlendStateInternal(const BLEND_STATE_DESC& desc, UINT32 id) const
  17. {
  18. SPtr<BlendState> ret = bs_shared_ptr<D3D11BlendState>(new (bs_alloc<D3D11BlendState>()) D3D11BlendState(desc, id));
  19. ret->_setThisPtr(ret);
  20. return ret;
  21. }
  22. SPtr<RasterizerState> D3D11RenderStateManager::createRasterizerStateInternal(const RASTERIZER_STATE_DESC& desc, UINT32 id) const
  23. {
  24. SPtr<RasterizerState> ret = bs_shared_ptr<D3D11RasterizerState>(new (bs_alloc<D3D11RasterizerState>()) D3D11RasterizerState(desc, id));
  25. ret->_setThisPtr(ret);
  26. return ret;
  27. }
  28. SPtr<DepthStencilState> D3D11RenderStateManager::createDepthStencilStateInternal(const DEPTH_STENCIL_STATE_DESC& desc, UINT32 id) const
  29. {
  30. SPtr<DepthStencilState> ret = bs_shared_ptr<D3D11DepthStencilState>(new (bs_alloc<D3D11DepthStencilState>()) D3D11DepthStencilState(desc, id));
  31. ret->_setThisPtr(ret);
  32. return ret;
  33. }
  34. }}