///////////////////////////////////////////////////////////////////////////////
// TnDX11RenderContext.h

#pragma once
#ifndef TN_DX11_RENDER_CONTEXT_INCLUDED
#define TN_DX11_RENDER_CONTEXT_INCLUDED

#include <RenderInterface/TnRenderInterface.h>

#include <wrl/client.h>
#include <d3d11_1.h>

namespace Tn {
namespace Graphics {

	using Microsoft::WRL::ComPtr;

	class DX11RenderContext : public RenderContext
	{
	private:

		ComPtr<ID3D11Device1>           m_d3dDevice;
		ComPtr<ID3D11DeviceContext1>    m_d3dContext;
		ComPtr<ID3D11RenderTargetView>  m_renderTargetView;
		ComPtr<ID3D11DepthStencilView>  m_depthStencilView;

	public:

		DX11RenderContext();
		virtual ~DX11RenderContext();

		void SetContext(ID3D11Device1 *device, ID3D11DeviceContext1 *context, ID3D11RenderTargetView *target, ID3D11DepthStencilView *depth);

		ComPtr<ID3D11Device1> const & GetDevice() const { return m_d3dDevice; }
		ComPtr<ID3D11DeviceContext1> const & GetContext() const { return m_d3dContext; }
		ComPtr<ID3D11RenderTargetView> const & GetColorTarget() const { return m_renderTargetView; }
		ComPtr<ID3D11DepthStencilView> const & GetDepthTarget() const { return m_depthStencilView; }

	};

	typedef boost::shared_ptr<DX11RenderContext> DX11RenderContextPtr;

} } // namespace Tn::Graphics

#endif // TN_DX11_RENDER_CONTEXT_INCLUDED
