View Full Version : front and back buffers

09-29-2005, 08:33 AM
Hi all,

I'm trying to do rubber band drawing in Windows using GL_COLOR_LOGIC_OP and GL_XOR. I tried to do this in the following way:

1. draw straight to the front buffer using

glDrawBuffer( GL_FRONT );


glDrawBuffer( GL_BACK );But everytime I try to write to the front color buffer the image gets corrupted, i.e. a garbled version of my original image.

So then I tried the follwing:

2. Copy the front buffer to the back buffer, draw the rubber band line and then swap buffers:

glFinish(); //just to be safe - makes no difference!
glDrawBuffer( GL_BACK );
glRasterPos2i( 0, 0 );
glReadBuffer( GL_FRONT );
glCopyPixels( 0, 0, wndRect.Width(), wndRect.Height(), GL_COLOR );


SwapBuffers( hDC );Still get the same result!

Can anyone suggest what may be wrong here? I would like to be able to do this without using overlay planes but maybe that's the best approach for this.

By the way this is in a Windows MDI app and when the app and current opengl enabled cview are maximized the color buffers are both fine. However, if either the app or the window is not maximized then the I get the problem described above!?


09-29-2005, 12:46 PM

I just tried this code on a different machine with a Nvidia GeForce4 card and it works fine!

The offending machine is running a Radeon 9550 in dual head mode! As far as I know I have the latest drivers for this card but I'm going to check again now. Anyone else have problems with this card?

09-29-2005, 01:12 PM
Latest driver solves this problem but now my screen cursor is blinking way too fast!