3

I grabbed this multi window test code, changed it to use D3DXCreateTeapot instead of D3DXLoadMeshFromX (I couldn't find a teapot.x file), moved the EndScene call below the DrawText call and set NUM_WINDOWS to 1. With those minor changes, the test works and creates two windows, each with its teapot.

I built the test and deployed it in a machine which has an Intel HD Graphics onboard GPU with two heads, each attached to a monitor. Then I moved one window to each monitor, and enlarged both windows to take up about 80% of each monitor space.

With this setup, which is quite close to what my app needs, the window in the secondary monitor always goes too slow. If I swap the windows, it's the same: the one in the secondary monitor starts crawling, and slows down the whole system.

I googled around and some sources (albeit dated) state that only the primary monitor can use hardware acceleration when not in fullscreen mode. I cannot use fullscreen because direct3d9 rendering in my app is done inside a user control embedded in a Winforms GUI.

Is it really impossible to get hardware acceleration for both monitors in windowed mode? The legacy version of our application uses MFC + DirectDraw and manages to perform fast enough, but those are obsolete technologies and we'd abhor going back there.

dario_ramos
  • 7,118
  • 9
  • 61
  • 108

1 Answers1

2

You have 3 options:

  1. Try many combinations, like: D3DPRESENT_INTERVAL_IMMEDIATE + (D3DSWAPEFFECT_FLIP or D3DSWAPEFFECT_COPY) + D3DCREATE_ADAPTERGROUP_DEVICE. Maybe some will offer better performance.

  2. Render to a surface, convert to a bitmap, and use it like any other bitmap in your form. Something like this D3DXSaveSurfaceToFileInMemory.

  3. Change your code to DirectX11. You have more options for GDI interaction there. Better rendering behavior. Maybe better drivers.

Some years ago, I made some multiple window code, also multiple device, using DirectX10/11. I can't tell about DirectX9 having this issue, seems absurd to me, but could be your Windows version, or Intel driver.

Marcos Zolnowski
  • 2,751
  • 1
  • 24
  • 29
  • About point 1, no matter what options I set, the secondary monitor is always slow. As if it couldn't enable hardware acceleration at all. Point 3 is not an option due to time constraints (Direct3d9 code is too large and not properly isolated to port to Dx11, as much as I'd love to do that). Gonna try point 2. In the meantime, +1 – dario_ramos Jul 15 '13 at 18:39