| DirectX video tearing on dual monitors |
|
 |
|
 |
|
 |
|
 |
Group: microsoft.public.win32.programmer.directx.graphics · Group Profile
Author: MenbraneMenbrane Date: Sep 11, 2008 22:52
I have a setup with a dual head video card (Intel GMA 950)
I need to synchronize both screens to render a different image at the same
time at exactly 60Hz without video tearing.
I am creating a device like this:
for (unsigned int i=0; i<2; ++i)
present_parameters[i].PresentationInterval=D3DPRESENT_INTERVAL_ONE;
CreateDevice(adapter_id, D3DDEVTYPE_HAL, window_id,
D3DCREATE_ADAPTERGROUP_DEVICE | D3DCREATE_MULTITHREADED |
D3DCREATE_NOWINDOWCHANGE |
D3DCREATE_SOFTWARE_VERTEXPROCESSING, present_parameters, &device );
Then I have a simple loop to check that the displays are not tearing:
for (int frame_index=0; frame_index
{
int n = frame_index/period;
unsigned int background_color = (n%%2==0)?0xff000000:0xffffffff;
for (unsigned int screen_index=0; screen_index
{
LPDIRECT3DSURFACE9 pBackBuffer = NULL;
device->GetBackBuffer( screen_index, 0, D3DBACKBUFFER_TYPE_MONO,
&pBackBuffer )
device->SetRenderTarget( 0, pBackBuffer )
device->Clear( 0, NULL, D3DCLEAR_TARGET, background_color, 1.0f, 0 );
pBackBuffer->Release();
}
device->Present( NULL, NULL, NULL, NULL );
}
It works well for the primary screen, but the second one is tearing (doesn't
sync properly with vertical refresh). I have tried many combinations of
D3DPRESENT_INTERVAL_ONE, D3DPRESENT_INTERVAL_DEFAULT and
D3DPRESENT_INTERVAL_IMMEDIATE to no avail. Is there a software solution to my
problem?
Regards,
|