OpenGL buffer operation?

How can i copy date between buffers, when you use double buffers?
I just want use glbegin and glend once, and copy what i drew to buffer. After that, every time programme calls display function, it won’t redraw it again. You can swap and copy or copy and swap. So one of these buffers always hold the image which should be display.

The contents of the back buffer is undefined after you’ve swapped buffers.

You can use glReadPixels() before swap, and then glDrawPixels() again later. However, this is not likely to be fast.

You can copy data into a texture using glCopyTexSubImage().

You can use the KTX_buffer_region extension, which does more or less what you want, except it’s kind-of poorly specified and not consistently implemented.

You can use glCopyPixels to copy data between buffers, too.

BUT, think of the backbuffer to be clipped like the front buffer. You must not assume pixels overlapped by other windows to be defined in the backbuffer.
For a working backing storage solution use a pbuffer for fully unclipped rendering and restore from there.

The ARB_buffer_region extension is also available in case the ill defined KTX_buffer_region extension doesn’t fit your needs.
Mind the things said about clipping and undefined pixel contents apply here, too.

I’m using wgl_arb_buffer_region to do extactly that. It’s pretty simple to use if you know how to use extensions. I can send you some source code if you want.

I’m not really sure about extensions. would you give me some detail? and source code is good as well.