See Care_and_Feeding_of_the_Swap_Chain and Handling_Window_Resizing
Quote1:
Naturally, the application's best route is to respond to WM_SIZE
, and call IDXGISwapChain::ResizeBuffers, passing the size contained in the message's parameters.
Quote2:
Before you call ResizeBuffers
, you must release all outstanding references to the swap chain's buffers. The object that typically holds a reference to a swap chain's buffer is a render-target-view.