Jump to content
  • Advertisement

Archived

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

llvllatrix

Flickerless GL with MFC

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

Advertisement
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
I think it''s a mistake in the book, unless they explain a reason for it. Returning false indicates that you did not handle the message (and it will be propegated up the message-handler call chain).

Share this post


Link to post
Share on other sites
doesnt really seam to make a difference; as long as i dont take the default action and just return a boolean everything seems fine.

Share this post


Link to post
Share on other sites
I tried using ipicture in mfc but the load failed; anyone know why?

I think its the dib in the loading code but im not sure...

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!