diff --git a/examples/osgviewerMFC/MFC_OSG_MDIView.cpp b/examples/osgviewerMFC/MFC_OSG_MDIView.cpp index a20a5a8e1..64be29736 100644 --- a/examples/osgviewerMFC/MFC_OSG_MDIView.cpp +++ b/examples/osgviewerMFC/MFC_OSG_MDIView.cpp @@ -17,6 +17,7 @@ BEGIN_MESSAGE_MAP(CMFC_OSG_MDIView, CView) ON_WM_CREATE() ON_WM_DESTROY() ON_WM_KEYDOWN() + ON_WM_ERASEBKGND() END_MESSAGE_MAP() CMFC_OSG_MDIView::CMFC_OSG_MDIView() : @@ -107,3 +108,9 @@ void CMFC_OSG_MDIView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) } } + +BOOL CMFC_OSG_MDIView::OnEraseBkgnd(CDC* pDC) +{ + /* Do nothing, to avoid flashing on MSW */ + return true; +} diff --git a/examples/osgviewerMFC/MFC_OSG_MDIView.h b/examples/osgviewerMFC/MFC_OSG_MDIView.h index 8afac3055..2caf35d98 100644 --- a/examples/osgviewerMFC/MFC_OSG_MDIView.h +++ b/examples/osgviewerMFC/MFC_OSG_MDIView.h @@ -43,6 +43,7 @@ protected: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnDestroy(); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); }; #ifndef _DEBUG // debug version in MFC_OSG_MDIView.cpp