making swapbuffers only copy

anyone know how to make the swapbuffers call only copy the backbuffer to the screen instead of swapping their contents?

i don’t draw the whole screen each frame, and i have it rigged so that i dont’ have to clear it every frame, either…

everything bounces once it’s done animating…

thx in advance if you know
-succinct

I don’t know if this is possible. At least not within the definition of the SwapBuffer(hDC); function. The two areas of memory reserved for front and back buffer do not actually get swapped during this call, merely the pointer to which is the designated front buffer is alternated.

There may be a way to draw to the accumulation buffer in a manner which would provide the results you are looking for.

Hmmm…

Glossifah

naah, i read some more… it says that the contents of the backbuffer are undefined after a call to SwapBuffers, and that consecutive calls to SwapBuffers may not produce similar results…

UGGH.

well, looks like i gotta clear each frame…

gotta be something…

at least it works in windowed mode

Actually, if your hardware supports a pixelformat where PFD_SWAP_COPY is true, you can swap the front and back buffers and the back buffer will remain the same. Your hardware must support this though. Try looping through all available pixelformats by calling
maxPixelFormats = DescribePixelFormat(hDC, 0, 0, NULL); (this gives the number of existing pixelformats – 24 of them are generic and always exist, so if you get maxpixelformats=48, then #1-24 are hardware specific)

Then loop from 1 to maxPixelFormats calling describepixelformat each time and test for the PFD_SWAP_COPY property. If you never get one that’s true, you’re screwed … but you can always buy a new video card that supports it. Oxygen vx1 does, but not in stereo.

Originally posted by Succinct:
[b]anyone know how to make the swapbuffers call only copy the backbuffer to the screen instead of swapping their contents?

i don’t draw the whole screen each frame, and i have it rigged so that i dont’ have to clear it every frame, either…

everything bounces once it’s done animating…

thx in advance if you know
-succinct[/b]

OpenGL has a function to copy a buffer directly into another one.

You could set the source buffer to GL_BACK, the destination buffer to GL_FRONT, and then just call the copy function.

For more information, look in http://heron.cc.ukans.edu/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/

Chapter 8 has the stuff you want.

j

j