CmDepthStencilState.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 DepthStencilState& DepthStencilState::getDefault()
  12. {
  13. static DepthStencilState depthStencilState;
  14. static bool initialized = false;
  15. if(!initialized)
  16. {
  17. depthStencilState.initialize(DEPTH_STENCIL_STATE_DESC());
  18. initialized = true;
  19. }
  20. return depthStencilState;
  21. }
  22. DepthStencilStatePtr DepthStencilState::create(const DEPTH_STENCIL_STATE_DESC& desc)
  23. {
  24. return RenderStateManager::instance().createDepthStencilState(desc);
  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. }