Forum > OpenGL

Flipping after glReadPixels

<< < (3/3)

gilsonalencar:

--- Quote ---That is strange, it's not just top to bottom, but left to right.

Are you calling this during your render while the context is still valid, and straight after you do the swapbuffers?

--- End quote ---

I'm calling this after do swapbuffers.

KpjComp:

--- Quote ---I'm calling this after do swapbuffers.

--- End quote ---

Oh, in that case is there any reason your doing ->

--- Code: ---c.Repaint;

--- End code ---
If your doing this during the Paint Event, then your telling your control to repaint during your paint event, doesn't really make sense.  The way I captured the screen is set a flag to say then next render will be captured, and after the render I would reset.   Not sure if this is your problem though, I'm not an OpenGL expert.

User137:
Some options:
1) You could try using Canvas.Copyrect() to flip the image to another TBitmap. It should support negative width and height in TRect.

2) Draw them 180 degree rotated when taking screenshot.

3) Same as 1), but copy pixel by pixel to inverse coordinates.

Navigation

[0] Message Index

[*] Previous page

Go to full version