I want also to notice, that I'm creating a window with flag WS_POPUP in order to hide title bar (it has to be hidden). Image tearing appears in different places. It's always in the top of a screen, but it can be on 20 px, and can be on 50 px. So, while creating window with title bar, image tearing sometimes can be simply not visible with the top part of image. And when I' m creating window without title bar, I can always see image tearing.
[source lang="cpp"]g_hWnd = CreateWindow( L"TutorialWindowClass", L"Direct3D 10 Tutorial 7", WS_POPUP | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, hInstance, NULL );[/source]
I've noticed this problem too. VSync simply doesn't seem to work that well in window mode, which is strange. You can try manually waiting for vsync with IDXGIOutput::WaitForVBlank and Present(0, 0), or by using DirectDraw vsync methods, though I'm not sure if it will make a difference.
Thanks for reply! I've just tried: [source lang="cpp"]m_pOutput->WaitForVBlank();m_pSwapChain->Present( 0, 0 );[/source] The same problem.
Are these values coming from a mode that you actually enumerate (via IDXGIOutput::GetDisplayModeList) or did you just assume that you were going to run on a 60hz monitor? It's quite important that they be the former; see http://msdn.microsof...5(v=vs.85).aspx
Often, developers choose 60 Hz as the refresh rate, not knowing that the enumerated refresh rate from the monitor is approximately 60,000 / 1,001 Hz from the monitor.
I was sure, that I'm going to run on 60hz monitor and manually set Numerator to 60 in order not to choose wrong mode programatically. Also, I run programm it in debug mode first and made sure, that monitor support this mode.