Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


nicolausYes

Member Since 12 Nov 2012
Offline Last Active Jul 11 2013 04:51 AM

Posts I've Made

In Topic: Direct3D 10 vsync problem in window mode with DWM disabled

14 November 2012 - 04:48 AM

Erik Rufelt, I've just tried on Microsoft's sample, still doesn't work( Vsync is working, but I can steel see image tearing.

[source lang="cpp"]#pragma comment( lib, "ddraw.lib " )#pragma comment( lib, "dxguid.lib" )#include <ddraw.h>// ...HRESULT InitDevice(){ // ... // Create DirectDraw device hr = DirectDrawCreateEx( NULL, (LPVOID*) &amp;amp;amp;g_pDevice7, IID_IDirectDraw7, NULL ); hr = g_pDevice7->SetCooperativeLevel( g_hWnd, DDSCL_NORMAL ); // ...}//...void Render(){ // ... // Do vsync g_pDevice7->WaitForVerticalBlank(DDWAITVB_BLOCKEND, NULL); g_pDevice7->WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, NULL); g_pSwapChain->Present( 0, 0 );}[/source]

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]

In Topic: Direct3D 10 vsync problem in window mode with DWM disabled

12 November 2012 - 09:32 AM

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.

In Topic: Direct3D 10 vsync problem in window mode with DWM disabled

12 November 2012 - 07:23 AM

swapChainDesc.BufferDesc.RefreshRate.Numerator = 60;
swapChainDesc.BufferDesc.RefreshRate.Denominator = 1;

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.

PARTNERS