Original Post
I'm writing an MFC SDI app that uses OpenGL, and sometimes I get refresh/repaint problems where portions of pulldown menus or popup menus remain visible in the viewport where OpenGL is drawn. All of my windows are created with the WS_CLIPSIBLINGS | WS_CLIPCHILDREN, and I use OpenGL double-buffering.
BOOL
CMyView::PreCreateWindow(CREATESTRUCT& cs) {
cs.style |= (WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
return CView::PreCreateWindow(cs);
}
BOOL
CMyView::OnEraseBkgnd(CDC* pDC) {
return TRUE;
}
void
CMyView::OnDraw(CDC* pDC) {
RenderGLScene();
}
I use almost the same code found in other OpenGL MFC tutorials on the web, so it's hard to tell why it's happening.