Full screen Direct3D9 device only displays at native resolution when second monitor is plugged in

522 views Asked by At

With a single monitor my program works in both windowed and full screen mode (using any resolution chosen from EnumAdapterModes), but when I plug in my second monitor (running the same code) I can create a full screen device at any resolution from EnumAdapterModes, but only at the native resolution (1600 x 900) does it display the scene, otherwise the screen is just black among other problems listed below.

What I've discovered so far:

  • This problem does not occur in windowed or multihead mode
  • I can still render to a texture (I had to switch modes to display it though)
  • All function calls return success codes (including TestCooperativeLevel)
  • If I try to draw to the back buffer using Clear or the DrawPrimitive functions or call Present (which still leaves a black screen), than calls to GetRenderTargetData fail and attempting to lock a volume texture will return different slice pitches at sub levels
  • Commercial games that use Direct3D9 (Portal) don't have any problem switching between resolutions with my second monitor plugged in so there must be a solution

The problem seems to be related to the back buffer created by the Direct3D9 run time but the only solution I can come up with is to force multihead mode on devices with multiple monitors, any ideas?

Question that seems to have the same problem but lacks a solution: How do I render a fullscreen frame with a different resolution than my display?

1

There are 1 answers

4
Alex On BEST ANSWER

Finally figured it out, seems to be a driver bug in Windows Vista and later and using Direct3D9Ex fixed the problem.

I didn't want to use Direct3D9Ex because it was only introduced on Windows Vista and I wanted to support Windows XP as a minimum, but MSDN has some sample code on how to support both so it's all good.