//	Darkstar Engine  (c) UnderWorld Interactive Studio (all coding by Svarog    2007)
//
//      Данный файл является частью Darkstar Engine. Любое использование кода файла
//      без согласия компании, является нарушением закона об авторском праве (в слу-
//      чае если не оговорено обратное).
//
//      Имя файла: render_state_manager.cpp
//      Краткое описание: Manager of render states values
//

#include <Darkstar/Graphic System/Render State/render_state_manager.hpp>

using gs::RenderStateManager;
using gs::FillModeRenderState;
using gs::CullModeRenderState;
using gs::DepthRenderState;
using gs::SamplerRenderState;
using gs::ColorWriteRenderState;
using gs::BlendRenderState;
using gs::SAMPLER_TYPE;

// RASTERIZER

const shared_ptr<FillModeRenderState>& RenderStateManager::getCurFillModeRenderState() const
{
	return new_fill_mode_state;
};

const shared_ptr<CullModeRenderState>& RenderStateManager::getCurCullModeRenderState() const
{
	return new_cull_state;
};

void RenderStateManager::setFillModeRenderState(const FillModeRenderState& fill_render_state)
{
	new_fill_mode_state.reset(new FillModeRenderState(fill_render_state));
};

void RenderStateManager::setCullModeRenderState(const CullModeRenderState& cull_render_state)
{
	new_cull_state.reset(new CullModeRenderState(cull_render_state));
};


// BLENDER


void RenderStateManager::setColorWriteRenderState(const ColorWriteRenderState& color_write_render_state)
{
	new_color_write_state.reset(new ColorWriteRenderState(color_write_render_state));
};

void RenderStateManager::setBlendRenderState(const BlendRenderState& blend_render_state)
{
	new_blend_state.reset(new BlendRenderState(blend_render_state));
};

const shared_ptr<ColorWriteRenderState>& RenderStateManager::getCurColorWriteRenderState() const
{
	return new_color_write_state;
};

const shared_ptr<BlendRenderState>& RenderStateManager::getCurBlendRenderState() const
{
	return new_blend_state;
};


// DEPTH-STENCIL

void RenderStateManager::setDepthRenderState(const DepthRenderState& depth_render_state)
{
	new_depth_state.reset(new DepthRenderState(depth_render_state));
};

const shared_ptr<DepthRenderState>& RenderStateManager::getCurDepthRenderState() const
{
	return new_depth_state;
};
