Archived

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

Flickerless GL with MFC

This topic is 5037 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

WOW! I can''t believe how easy that was!

All I did was right-click on the view class, click Add Windows Message Handler, choose WM_ERASEBKGD just like Magmai Kai said, clicked Add and Edit, and made this change:

BOOL CMDIModeler3View::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default

//return CView::OnEraseBkgnd(pDC);
return true;

}

in other words, instead of calling CView::OnEraseBkgnd I just return true.

I can''t believe this, I''ve been working on my MDI Modeler for almost a year and living with that *($#*($#(* flicker and the whole time it''s like a one-minute change!

Love means nothing to a tennis player

My nothing-to-write-home-about OpenGL webpage. (please pardon the popups!)

Share this post


Link to post
Share on other sites
Hi.

I''m a "wanna be" OpenGL programmer who just doesn''t have the time (and truth be told, the talent) to do some OpenGL programs.

Anyway, from "OpenGL Superbible" by Richard S Wright Jr & Michael Sweet, the section on MFC (page 642) says that the view''s OnEraseBkgnd function should return false.

Since returning true seems to work for you Matrix, does it matter what really is returned?

I''m just curious more than anything.

Share this post


Link to post
Share on other sites
llvllatrix I had that problem in my app and it was because I sent the wrong RC to wglCreateContext - wglCreateContext must be called before loading textures. I had a different situation where I had two rendering contexts (one the main view window the other a "preview" on a form), and you actually have to either use wglShareContexts (don''t remember the exact function call) or you actually have to load the textures twice.

Hope this helps

Love means nothing to a tennis player

My nothing-to-write-home-about OpenGL webpage. (please pardon the popups!)

Share this post


Link to post
Share on other sites