| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #include "BsDepthStencilState.h"
- #include "BsRenderStateManager.h"
- #include "BsRenderSystem.h"
- #include "BsDepthStencilStateRTTI.h"
- #include "BsException.h"
- #include "BsResources.h"
- namespace BansheeEngine
- {
- DepthStencilProperties::DepthStencilProperties(const DEPTH_STENCIL_STATE_DESC& desc)
- :mData(desc)
- {
- }
- DepthStencilStateCore::DepthStencilStateCore(const DEPTH_STENCIL_STATE_DESC& desc)
- : mProperties(desc)
- {
- }
- const DepthStencilProperties& DepthStencilStateCore::getProperties() const
- {
- return mProperties;
- }
- DepthStencilState::DepthStencilState(const DEPTH_STENCIL_STATE_DESC& desc)
- :mProperties(desc)
- {
- }
- SPtr<DepthStencilStateCore> DepthStencilState::getCore() const
- {
- return std::static_pointer_cast<DepthStencilStateCore>(mCoreSpecific);
- }
- SPtr<CoreObjectCore> DepthStencilState::createCore() const
- {
- return RenderStateCoreManager::instance().createDepthStencilStateInternal(mProperties.mData);
- }
- const DepthStencilStatePtr& DepthStencilState::getDefault()
- {
- return RenderStateManager::instance().getDefaultDepthStencilState();
- }
- const DepthStencilProperties& DepthStencilState::getProperties() const
- {
- return mProperties;
- }
- HDepthStencilState DepthStencilState::create(const DEPTH_STENCIL_STATE_DESC& desc)
- {
- DepthStencilStatePtr depthStencilPtr = RenderStateManager::instance().createDepthStencilState(desc);
- return static_resource_cast<DepthStencilState>(gResources()._createResourceHandle(depthStencilPtr));
- }
- /************************************************************************/
- /* RTTI */
- /************************************************************************/
- RTTITypeBase* DepthStencilState::getRTTIStatic()
- {
- return DepthStencilStateRTTI::instance();
- }
- RTTITypeBase* DepthStencilState::getRTTI() const
- {
- return DepthStencilState::getRTTIStatic();
- }
- }
|