void OpenGLRasterizerState::set(const RasterizerStateDescription &new_state)
{
	if (!(new_state == desc))
	{
		desc = new_state.clone();
		changed_desc = true;
	}
}
std::shared_ptr<RasterizerStateProvider> D3DGraphicContextProvider::create_rasterizer_state(const RasterizerStateDescription &desc)
{
	std::map<RasterizerStateDescription, std::shared_ptr<RasterizerStateProvider> >::iterator it = rasterizer_states.find(desc);
	if (it != rasterizer_states.end())
	{
		return it->second;
	}
	else
	{
		std::shared_ptr<RasterizerStateProvider> state(new D3DRasterizerStateProvider(window->get_device(), desc));
		rasterizer_states[desc.clone()] = state;
		return state;
	}
}
	std::shared_ptr<RasterizerStateProvider> GL3GraphicContextProvider::create_rasterizer_state(const RasterizerStateDescription &desc)
	{
		auto it = rasterizer_states.find(desc);
		if (it != rasterizer_states.end())
		{
			return it->second;
		}
		else
		{
			std::shared_ptr<RasterizerStateProvider> state(new OpenGLRasterizerStateProvider(desc));
			rasterizer_states[desc.clone()] = state;
			return state;
		}
	}