Advertisement

Flickerless GL in a Dialog

Started by March 15, 2004 07:44 PM
7 comments, last by llvllatrix 20 years, 11 months ago
I managed to get gl rendering in a dialog box; problem is, when i try to get it updated using an on_timer call if flickers like mad...anyone know why? I tried to look for a ON_WM_ERASEBKGND message but there wasnt one. Edit: Forgot to mention i draw on WM_PAINT - might be the problem tia, - llvllatrix [edited by - llvllatrix on March 15, 2004 8:49:36 PM]
Maybe you should try Lesson01 - draw every loop.

If you know Celestia, it also runs on OpenGL. It has no flickers: but it receives the WM_PAINT message as frequently as possible. Maybe that is the problem?

If you need to keep time (I guess that''s why you use timer event) maybe you can try timeGetTime().

Cheers
Singulab
Advertisement
What do you mean when you say you looked for an erase background event and there wasn''t one? Are you just doing a Win32 application? I thought you could add your own events to that, i.e. WM_LBUTTONDOWN and whatnot, am I wrong?

In MFC, you can add a message handler for the WM_ERASEBKGND method and just not call the default handler and that takes care of the flicker problem. I don''t know how to do it in just a Win32 application, sorry .

I don''t think WM_PAINT is the problem - I do my rendering there too.

Love means nothing to a tennis player

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

Im using mfc; there was no WM_ERASEBKGRD message in the class wizzard...might have to do it manually.
Try to activate the rendering context each frame, that might fix it.
Yep; actually, i have two rendering contexts going at once, so i have to.
Advertisement
I tried manually adding ON_WM_ERASEBKGND and it worked; no more flickers !
MFC has a member called OnEraseBkgnd. It''s been awhile since I used MFC so I''m not certain, but it seems to me, if you are inheriting from CWND as your window, you may be able to just override the OnEraseBkgnd member, and don''t do anything inside it.
variant: Thats true.

This topic is closed to new replies.

Advertisement