您的位置:首页 > 运维架构

使用opengl在windows窗体中绘图时闪烁的问题

2010-05-17 16:19 423 查看

OPENGL MFC 闪烁

The flicker occurs because Windows paints the background first and then OpenGL next. Since we have OpenGL doing the job of clearing the background, we'll turn off Windows from clearing the background. This can be done by editing OnEraseBkgnd() member function appropriately. We do this by returning true from the function.

BOOL COpenGLView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
//comment out the original call
//return CView::OnEraseBkgnd(pDC);
//Tell Windows not to erase the background
return TRUE;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: