0

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?

Community
  • 1
  • 1
Alex
  • 201
  • 2
  • 10

1 Answers1

0

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.

Alex
  • 201
  • 2
  • 10
  • I wouldn't be concerned about XP it goes out of support in April 2014. Also most gamers are on Windows 7 and have hardware to match. – Mgetz Dec 26 '13 at 01:34
  • I'm mostly a console gamer so I still have XP (my desktop) and I know a few people who still have it as well, but I'm starting game development for PC and I mostly use my laptop for development now (Windows 7), but my laptop isn't exactly a gaming machine. – Alex Dec 26 '13 at 02:11
  • Just a reminder Microsoft won't be patching XP after this coming April, and DirectX 9 is officially deprecated at this point, I would not expect it to act as reliably as DirectX 10/11 – Mgetz Dec 26 '13 at 03:47
  • I'm using a plugin based approach and my Direct3D9 plugin is basically done already (even if it's short lived, their replaceable for portability) and I'll write a DirectX 11 and an OpenGL plugin in the future anyway. – Alex Dec 26 '13 at 05:32