I'm writing an MDI app using Managed dx9.
When I create the Device, I pass in a control.
If I pass in one of the MDI child windows (or more specifically, a control in the MDI child window), everything renders fine. I can spawn new child MDI windows and draw to each of these individually. I can close any of the new windows, no problem. But if I close the original child window, Device.Clear() throws an exception (null reference exception - the Device has been disposed).
Alternatively, I can pass Form1 to the Device constructor. Now I can open and close as many child windows as I like without getting the exception, but now the render resolution isn't quite right - the graphics aren't as crisp as when I pass the child window to the Device constructor.
So my first questions are: Can I specify the resolution when I construct the device? Which control / window should I pass to the Device constructor? What am I doing wrong? :)
Thanks
Tim