CRenderTarget::CRenderTarget (const DWORD width, const DWORD height) : m_pModel (nullptr),
m_background (nullptr),
m_modelRotation (0),
m_visible (false)
{
auto pTex = new CGraphicRenderTargetTexture;
if (!pTex->Create(width, height, D3DFMT_A8R8G8B8, D3DFMT_D16))
{
delete pTex;
TraceError ("CRenderTarget::CRenderTarget: Could not create CGraphicRenderTargetTexture %dx%d", width, height);
throw std::runtime_error ("CRenderTarget::CRenderTarget: Could not create CGraphicRenderTargetTexture");
}
m_renderTargetTexture = std::unique_ptr<CGraphicRenderTargetTexture> (pTex);
}