CmDepthStencilState.cpp 1.2 KB

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