Archived

This topic is now archived and is closed to further replies.

Flickering problem in windowed mode with DX8

This topic is 5045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using DX8 in an MFC single document app. I''m encountering a strange flickering problem when moving the view. It seems that the top 75 or so pixels refresh after the rest of the pixels. This means that as the view moves, line that is going straight up will be clearly broken for a very small period of time. I try to take a screen shot of this, but either I am unlucky or Windows isn''t taking a screen shot of what it is actually rendering. I guess there isn''t a good way of saying what''s going on, but if any of you have an idea what could be wrong, it would be helpful. Here''s my device creation code, if it helps:
D3DDISPLAYMODE d3ddm;
if(FAILED(m_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm)))
{
	MessageBox("Failed to get the video adapter''s display mode");
	return E_FAIL;
}

D3DPRESENT_PARAMETERS d3dpp; 
ZeroMemory(&d3dpp, sizeof(d3dpp));

d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC;
d3dpp.BackBufferFormat = d3ddm.Format;
d3dpp.BackBufferCount = 1;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
d3dpp.EnableAutoDepthStencil = TRUE;
d3dpp.hDeviceWindow = GetSafeHwnd();

CRect rc;
GetClientRect(&rc);

d3dpp.BackBufferWidth = rc.Width();
d3dpp.BackBufferHeight = rc.Height();

if(FAILED(m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, GetSafeHwnd(), 
		D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &m_pD3DDevice)))
{
	return E_FAIL;
}

Share this post


Link to post
Share on other sites
I''ve discovered something that may help.

I have a big dialog bar on the window, and if I take it out, and the status bar, and the toolbar, everything works fine. The area that works normally is equal or very close to the same size as the toolbar, dialog bar, and status bar combined. If I take one out, the area size changes accordingly. Maybe this will help.

Share this post


Link to post
Share on other sites
I have had the same problem before but nothing helped
(including changing the presentation parameters which
reduced the tearing but did not eliminate it entirely) so
I just changed my program to a fullscreen one. I set a
variable so that I can still run in windowed mode during
development and change to fullscreen when necessary.

_________________
Best regards,
Sherman Chin
www.Sherman3D.com

Share this post


Link to post
Share on other sites