I am rendering an animation into a window. Each frame, I draw the scene, then read the pixels into a byte array, then I create a windows rgn from this byte array.
It works great, but it seems the rgn is 1 frame behind.
Could be a double buffer related problem, but it shouldnt, you copy data from the same buffer that you render to so you should get the same stuff as you render as long as you copy the contents at the end of the rendering step.