IDirect3DSwapChain9 Device Reset problem with different size back buffers.
I am developing a Direct3D X file GUI editor and am having a problem with how to display multiple views with the same device. I started out with the Skinned Mesh Direct3D example and added four views using MFC classes derived from CMDIFrameWnd as the main frame, CMDIChildWnd as the child windows that have four splitter windows displayed in the child windows client area. Each splitter window pane in each MDI child window displays a different view of the model (a perspective view, and orthogonal top, left, and front). Since I started with the Skinned Mesh example, the splitter pane views actually use the same render view and is pretty much implemented the same as the Skinned Mesh example.
What I am doing right now, just to get it working, is loading my meshes four different times for each splitter pane view. I have not changed the code yet nor have I moved the mesh, frame, and animation data into the document class where it would only be loaded once. I would now like to do that, but there is a problem…
If I load the mesh from the derived CDocument class, I would need to first setup the ID3DXDevice9 interface and then load the mesh. My Document View class for each splitter pane would have to create a IDirect3DSwapChain9 interface each time a view is created – the problem is that if the splitter panes are resized, the IDirect3DDevice9::Reset() function needs to be called to reset the device… which takes a pointer to the D3DPRESENT_PARAMETERS where the back buffer height and width are defined for the device… but if my splitter panes have different widths and heights, their back buffers will also.
How do you use a device swap chain if the back buffers are different sizes?
ANY HELP WOULD GREATLY BE APPRECIATED.
And to anyone that responds to this post, could explain exactly what I would have to do to implement the swap chains, it would help. I also assume that I should create a different device9 interface for each MDI Child Window (one for all 4 splitter panes)… if there is more than one document open at a time, then there will have been just as many devices created. I am pretty sure this is the way it should be – as far as I know, if the program has multiple documents open, there should NOT be just one device opened for the entire program - Is this the right way to do things – (I just want to make sure) – or is there a way to not link a mesh to a device when you load it. And if so, how would you render the mesh.
My email address is: email@example.com