After about ten hours straight, including a lot of fun and frivolity as described in this thread, I now have the basics working properly.
The ortho views now render everything in the correct order based on sorting the vertices and faces based on whatever the appropriate depth dimension is for each view. Faces and vertices can be set as selected (in code only at the moment) and appear in red instead of white.
The perspective view is now handling occlusion properly and can also paint selected vertices and faces a different colour, ensuring it draws the selected faces after the non-selected ones to avoid an overwrite of a white line over a red one (again by sorting).
Rotation also works properly in the perspective view now and all views can be zoomed with the mousewheel or dragged about using Ctrl and the mouse.
This has been an uphill struggle from the word go, but I've learned a lot. Two things I learned that bit me well and truly on the bottom where:
- You can't rely on EnableAutoDepthStencil when using multiple swap-chains
- If you mess up your projection matrix, for some reason the depth buffer won't enable
Both are a bit messed up in my option. Since you are using the D3DPRESENT_PARAMETERS to create each swap chain, you would think the values would be valid. Equally, the debug runtimes were less than helpful with the second issue.
But anyway, bad workman blames his tools and so on, so all good that I was able to persevere and get all the issues sorted out.
Now on to the next impossible and incomprehensible problem I guess. Tally ho!