Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualf12dude

Posted 13 January 2013 - 10:56 PM

I have vsync enabled in my game. In windowed mode, input lag seems to be much less than compared to fullscreen mode. I've tried to pinpoint where this input lag is coming from while in fullscreen, but I just don't know where to look anymore.

 

This is my windows message loop:

 

do
	{
		MSG msg;
		while(PeekMessage(&msg,0,0,0,PM_REMOVE) > 0)
		{
			if(msg.message == WM_QUIT)
			{
				return false;
			}

			TranslateMessage( &msg );
			DispatchMessage( &msg );
		}
		
		if(m_bPaused)
		{	
			Sleep(20);
		}

	} while(m_bPaused);

	return true;

 

 

And this is how I init directx 9:

 

D3DPRESENT_PARAMETERS m_D3DParameters;

m_D3DParameters.BackBufferWidth            = width;
m_D3DParameters.BackBufferHeight           = height;
m_D3DParameters.BackBufferFormat           = D3DFMT_X8R8G8B8;
m_D3DParameters.BackBufferCount            = 1;
m_D3DParameters.MultiSampleType            = D3DMULTISAMPLE_NONE;
m_D3DParameters.MultiSampleQuality         = 0;
m_D3DParameters.SwapEffect                 = D3DSWAPEFFECT_DISCARD; 
m_D3DParameters.hDeviceWindow              = windowHandle;
m_D3DParameters.Windowed                   = false;
m_D3DParameters.EnableAutoDepthStencil     = true;
m_D3DParameters.AutoDepthStencilFormat     = D3DFMT_D24S8;
m_D3DParameters.Flags                      = 0;
m_D3DParameters.FullScreen_RefreshRateInHz = RefreshRate;
m_D3DParameters.PresentationInterval       = D3DPRESENT_INTERVAL_DEFAULT;

 

 


#1f12dude

Posted 13 January 2013 - 10:53 PM

I have vsync enabled in my game. In windowed mode, input lag seems to be much less than compared to fullscreen mode. I've tried to pinpoint where this input lag is coming from while in fullscreen, but I just don't know where to look anymore.

 

This is my windows message loop:

 

do
	{
		MSG msg;
		while(PeekMessage(&msg,0,0,0,PM_REMOVE) > 0)
		{
			if(msg.message == WM_QUIT)
			{
				return false;
			}

			TranslateMessage( &msg );
			DispatchMessage( &msg );
		}
		
		if(m_bPaused)
		{	
			Sleep(20);
		}

	} while(m_bPaused);

	return true;

 

 

And this is how I init directx 9:

 

D3DPRESENT_PARAMETERS m_D3DParameters;

m_D3DParameters.BackBufferWidth            = width;
m_D3DParameters.BackBufferHeight           = height;
m_D3DParameters.BackBufferFormat           = D3DFMT_X8R8G8B8;
m_D3DParameters.BackBufferCount            = 1;
m_D3DParameters.MultiSampleType            = D3DMULTISAMPLE_NONE;
m_D3DParameters.MultiSampleQuality         = 0;
m_D3DParameters.SwapEffect                 = D3DSWAPEFFECT_DISCARD; 
m_D3DParameters.hDeviceWindow              = windowHandle;
m_D3DParameters.Windowed                   = false;
m_D3DParameters.EnableAutoDepthStencil     = true;
m_D3DParameters.AutoDepthStencilFormat     = D3DFMT_D24S8;
m_D3DParameters.Flags                      = 0;
m_D3DParameters.FullScreen_RefreshRateInHz = RefreshRate;
m_D3DParameters.PresentationInterval       = D3DPRESENT_INTERVAL_DEFAULT;

 

 


PARTNERS