BsDepthStencilState.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #include "BsDepthStencilState.h"
  5. #include "BsRenderStateManager.h"
  6. #include "BsRenderSystem.h"
  7. #include "BsDepthStencilStateRTTI.h"
  8. #include "BsException.h"
  9. #include "BsResources.h"
  10. namespace BansheeEngine
  11. {
  12. void DepthStencilState::initialize(const DEPTH_STENCIL_STATE_DESC& desc)
  13. {
  14. mData = desc;
  15. Resource::initialize();
  16. }
  17. const DepthStencilStatePtr& DepthStencilState::getDefault()
  18. {
  19. return RenderStateManager::instance().getDefaultDepthStencilState();
  20. }
  21. HDepthStencilState DepthStencilState::create(const DEPTH_STENCIL_STATE_DESC& desc)
  22. {
  23. DepthStencilStatePtr depthStencilPtr = RenderStateManager::instance().createDepthStencilState(desc);
  24. return static_resource_cast<DepthStencilState>(gResources()._createResourceHandle(depthStencilPtr));
  25. }
  26. /************************************************************************/
  27. /* RTTI */
  28. /************************************************************************/
  29. RTTITypeBase* DepthStencilState::getRTTIStatic()
  30. {
  31. return DepthStencilStateRTTI::instance();
  32. }
  33. RTTITypeBase* DepthStencilState::getRTTI() const
  34. {
  35. return DepthStencilState::getRTTIStatic();
  36. }
  37. }