Move DirectX window from one monitor to another in extended mode
I have a simple directX-9 test app that I want to move from one monitor to another in extended mode.
The window and the device are created on the primary monitor and scene is drawn correctly but when I move my window to the second monitor it will freeze. There is no error and even the present calls do not fail but the开发者_高级运维re is no update of the window. As soon as I move the window back to the primary monitor everything is fine again. Can anyone give me a hint what am I missing to get this working?Make sure to enumerate over your adapter modes. The mode you are using might have a problem with the graphics card. Also, for each format that an adapter supports there is a list of display modes based on the number of modes available. Here's a quick example of looping through these modes:
D3DDISPLAYMODE mode;
UINT adapter = 0;
D3DFORMAT format = D3DFMT_R5G6B5;
LPDIRECT3D9 pD3D;
pD3D = Direct3DCreate9( D3D_SDK_VERSION );
if(!pD3D) return FALSE;
UINT availableModes = pD3D->GetAdapterModeCount(Adapter, Format);
if(!availableModes) return FALSE;
for(UINT i = 0; i < availableModes; i++)
{
pD3D->EnumAdapterModes( adapter, format, i, &mode);
formatModeList->push_back(mode); // A list of modes
}
Also, make sure you are NOT using flipping if you are in windowed mode. In windowed mode, you share the current video mode of the applications running. Unfortunately, you have to use the slower blitting process. Hopefully this helps.
Regards,
Will
精彩评论