CmDepthStencilState.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "CmDepthStencilState.h"
  2. #include "CmRenderStateManager.h"
  3. #include "CmRenderSystem.h"
  4. #include "CmDepthStencilStateRTTI.h"
  5. #include "CmException.h"
  6. namespace CamelotFramework
  7. {
  8. void DepthStencilState::initialize(const DEPTH_STENCIL_STATE_DESC& desc)
  9. {
  10. mData = desc;
  11. Resource::initialize();
  12. }
  13. const DepthStencilStatePtr& DepthStencilState::getDefault()
  14. {
  15. return RenderStateManager::instance().getDefaultDepthStencilState();
  16. }
  17. HDepthStencilState DepthStencilState::create(const DEPTH_STENCIL_STATE_DESC& desc)
  18. {
  19. DepthStencilStatePtr depthStencilPtr = RenderStateManager::instance().createDepthStencilState(desc);
  20. return static_resource_cast<DepthStencilState>(Resource::_createResourceHandle(depthStencilPtr));
  21. }
  22. /************************************************************************/
  23. /* RTTI */
  24. /************************************************************************/
  25. RTTITypeBase* DepthStencilState::getRTTIStatic()
  26. {
  27. return DepthStencilStateRTTI::instance();
  28. }
  29. RTTITypeBase* DepthStencilState::getRTTI() const
  30. {
  31. return DepthStencilState::getRTTIStatic();
  32. }
  33. }