Issue with SwapBuffers and flickering effect.
I have an external opengl based library which I'm trying to integrate in my application. It renders properly if SwapBuffers() is removed from the rendering function. If I keep swapbuffers(), it keeps flicker whenever the window is zoomed or panned. Moreover it is not displayed when no mouse event is performed. My render functions contain opengl commands which very much requires SwapBuffer() function.
How do I avoid this flickering? I feel probably the library renders on back buffer frame, and when the swap buffer is called it gets washed away, thus resulting in display for a fraction of second and disappear. Any suggestions/solutions?
First couple of things I would check is to make sure that double buffering is used, check if the library or your code is calling the display function instead of using glPostRedisplay, check placement of clear buffer, check conflicting viewports, ... Since at least the mouse events does do something, I would look at the mouse callbacks quickly.