glReadPixels on X11 sometimes returns wrong pixels
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
So I tracked down the reason why I didn't turn image caching on in the QVTKWidget yet.
glReadPixels() is returning the wrong pixel data.
glXSwapBuffers() is called, then the next gl/glx call is glReadPixels(). Apparently, glXSwapBuffers() doesn't really happen in time for glReadPixels() to be called (client/server X11 involved).
If I add a call to glXWaitX() or glXWaitGL() before the call to glReadPixels() I get the correct pixel data.
I'm not sure where the right place is to make this gl/glx synchronization happen.