JP Bridges
Newcomer
- Joined
- Jul 19, 2003
- Messages
- 11
Folks,
I'm trying to get D3D views running in multiple panels of my windows forms application.
I derive a class from panel and set as a member variable a SwapChain object. I then pass a valid D3D Device to this class in the constructor and steal it's present parameters (changing DeviceWindow and DeviceWindow handle to this and this->Handle respectively).
This works fine and I can create multiple instances of these controls all of which display valid D3D data.
I do the drawing (currently only Device::Clear) in the panels Paint event handler, this works great.
However when I resize the window things go pear shaped and I get an exception thrown saying the swap chain is trying to dispose itself.
Now I guess that the swap chain is destroying itself because the back buffer size no longer matches the size of the control. Which is fine.
However I can't seem to handle this gracefully, I mean do I try and watch if the SwapChain:isposed property is true, and if it is then create a whole new SwapChain, or is there a better way to do it... the documentation seems to offer no clues.
Anybody?
JP
I'm trying to get D3D views running in multiple panels of my windows forms application.
I derive a class from panel and set as a member variable a SwapChain object. I then pass a valid D3D Device to this class in the constructor and steal it's present parameters (changing DeviceWindow and DeviceWindow handle to this and this->Handle respectively).
This works fine and I can create multiple instances of these controls all of which display valid D3D data.
I do the drawing (currently only Device::Clear) in the panels Paint event handler, this works great.
However when I resize the window things go pear shaped and I get an exception thrown saying the swap chain is trying to dispose itself.
Now I guess that the swap chain is destroying itself because the back buffer size no longer matches the size of the control. Which is fine.
However I can't seem to handle this gracefully, I mean do I try and watch if the SwapChain:isposed property is true, and if it is then create a whole new SwapChain, or is there a better way to do it... the documentation seems to offer no clues.
Anybody?
JP