CmDepthStencilState.cpp 1.1 KB

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