View Full Version : glClear() and GL_AUX0

11-26-2002, 03:43 PM
I'm writing an image to buffer GL_AUX0 and want it to stay there for the duration of my program. Whenever I call 'glClear(GL_COLOR_BUFFER_BIT)', however, I clear GL_AUX0, even when I preceed the glClear() call with 'glDrawBuffer(GL_FRONT|GL_BACK)' (have also tried 'glDrawBuffer(~GL_AUX0)'). -- Help!

11-26-2002, 07:41 PM
glDrawBuffer doesn't take a bitfield. It takes an enum.

GL_FRONT | GL_BACK doesn't do what you think it will do. (At least I don't think so, but I haven't checked the enum values). "~GL_AUX0" also doesn't do what you think it will do. Both may be errors, which would leave your old draw buffer state around.

If you call glDrawBuffer(GL_BACK), that should stop writing to AUX0.

And if you get weird behavior like this, please call glGetError(). We put this checking code into OpenGL for a reason.