Yes, it could be implemented, although it is not trivial because having different devices won't allow us to share resources. Now we are internally sharing resources between renderers (meshes cache, texture glyphs, ...).
The book solution for handling multiple devices resources is simply to hold a set of resouces per device and use them in the correct context.
The application code should issue a call for IRenderer::SetCurrentDevice before rendering to the selected device and then you'll be able to use the correct resouces set.
You'll also have to add callbacks for Device created and Device destroyed..
On Vista and above you can take advantage of the sharing resouces capability, but device must be created as D3D9Ex devices.
http://msdn.microsoft.com/en-us/library ... s.85).aspx
There is a sample project by Microsoft that shows sharing surfaces capability between multiple rendering APIs
http://archive.msdn.microsoft.com/D3D9E ... aseId=3435
Any way, there is something I do not understand. When I have a single window and it is moved to a new monitor, the device is also recreated. Is that behavior on purpose?
Yes it is.
The reason is that Device is created on a specific physical Adapter, actually the first parameter for IDirect3D9::CreateDevice is the adapter index, and performance is tightly affected from that fact.
If the device won't be changed when moving to different physical window controlled by different physical adapter the driver will perform heavy copy operation before displaying any content and you'll get a noticeable performance hit.
You can see detailed explanations in the D3D9 Sample framework - look for DXUTCheckForWindowChangingMonitors function.