[...]
Then I texture the pixel data onto a rectangle. This rectangle does flicker and flip diagonally from time to time and I wonder if it is an error on my machine only and where it could come from.
I don't see any flicker in your patch. (linux / intel GPU)
Thank you Cyrille for this helpful information!
Jack, I am on Debian GNU/Linux with an onboard Intel graphics controller (i915 variant).
OK, i guessed you were on nvidia because if you are not sync to vblank, you often get a line diagonaly separating two pictures. It is called "screen tearing".
Thank you, in my case it is not a missing sync to vblanc but a more drastic flicker. Also thanks for testing my patch and getting back to me on that, it is much appreciated!
P