Quick question guys... I am currently working with Directx3D and 2D and I was wondering if I have to recreate the render target when the Windows is resized or does Direct2D automatically detects this, since it's bound to the DXGISurface(back-buffer of the swapchain) when I created it.
Here is the code that I used to bind the render targets together:
ComPtr<IDXGISurface1> dxgibackBuffer;
hr = m_pDxSwapchain->GetBuffer(0, IID_PPV_ARGS(&dxgibackBuffer));
D2D1_BITMAP_PROPERTIES1 bitmapProperties = D2D1::BitmapProperties1(
D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE),
96.0f,
96.0f);
hr = m_pD2DContext->CreateBitmapFromDxgiSurface(dxgibackBuffer.Get(), &bitmapProperties, &m_pD2DTargetBitmap);
// last step
m_pD2DContext->SetTarget(m_pD2DTargetBitmap.Get());