PDA

View Full Version : how to Swap buffers from single to double?



robert_s
05-19-2001, 03:44 PM
hi all I would like to know how to swap buffers from double buffering to single just for a moment while running my program at the same time!
The reason for that is because I am comparing 2 images pixel by pixel and I would like to switch to single buffer to see each pixel being drawn which gives quite a nice effect whereas double bufferring won't give this nice effect. When using Double it just waits until all pixels are dawn into memory then after it simply displays them in one go which is not what I want!
Is ther anything like say.
if ( flag ) //true then sinlge buffer
else //carry on wtih double buffer

any suggestions?
Thank you very much indeed!!! http://www.opengl.org/discussion_boards/ubb/smile.gif

Korval
05-19-2001, 06:58 PM
I don't remember the exact command, but I'm pretty sure there is a function that sets which buffer you render to. Normally, you render to the back buffer, but you could set it to render to the front buffer instead.

As for actually shutting off the back buffer, that is likely not possible. The option to use or not use a back buffer is part of the pixel format (in Windows, at least), and the pixel format is used to generate a rendering context.

robert_s
05-20-2001, 12:42 AM
Thanks Korval!! I am sure there should be something but I just can't find it!
It works when I set it to glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); but obviously I can't keep changing the line from SINGLE to DOUBLE while running the program! THX!!

ET3D
05-20-2001, 03:29 AM
glDrawBuffer(GL_FRONT) should do what you want

robert_s
05-20-2001, 06:07 AM
Thanks!! Guys for help!!
ET3D was right!! It works!!
glDrawBuffer() was what I was looking for!!
I really appreciate that!!