View Full Version : Is there any way to prevent the screen from flashing when swapbuffering
11-15-2005, 05:06 PM
I am using double buffers. Each time when I call swapbuffers after I render, the screen flashes, which makes my eyes uncomfortable. Is there any solution to this problem.
11-15-2005, 11:11 PM
I am using Visual C++6.0
11-15-2005, 11:16 PM
Are you sure that you have setup doublebuffering correct ? because if you do there should be no flashing at all.
11-15-2005, 11:46 PM
Have you tried turning vsync on?
11-16-2005, 03:14 AM
I think I need to write my problem in detail. I call OpenGL functions including swapbuffers in OnDraw function of a window. And I popup a messagebox for the user to select something frequently. When the focus return to the window, the window's OnDraw function is run automatially, and its screen flashes. That is the problem.
Who knows how to do?
11-16-2005, 03:30 AM
Originally posted by Overmind:
Have you tried turning vsync on?I turned it on. But it did not work.
11-16-2005, 03:43 AM
Could be that the window is cleared with GDI during the WM_ERASEBKGND message.
Implement a handler for OnEraseBkgnd() which just returns non-zero.
That means it does no rendering and also does not route the message to the default window message handler which normally erases the background for you.
This should prevent GDI from clearing the window and only your OpenGL redraw should update it flicker free.
11-16-2005, 01:54 PM
Relic, Thank you. It is done.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.