PDA

View Full Version : Does glXMakeCurrent switch buffer?



kobebryant
01-18-2006, 08:41 AM
I've been successfuly running OpenGL on several platforms including Linux(RedHat,Suse), Unix(Sun, HP) workstations and PC windows using mixed (single/double)buffer.

However, because my new IBM AIX workstation only allows double buffer for the framebuffer config, I had to use it with "glDrawBuffer(GL_FRONT)" just after "glXChooseVisual()" when single buffer is neeed. It did not work out.

Turned out, glXMakeCurrent() put the buffer back
to back buffer. I checked it with "glGetInteger()"
before and after the "glXMakeCurrent()".

Why does it switch the buffer to back from front?
Am I doing something wrong?

In addition, is there going to be a performance change if I use "glDrawBuffer(GL_FRONT_AND_BACK)" instead of "glDrawBuffer(GL_FRONT)" ,

-Thanks.

K.B.

Michael Gold
01-19-2006, 01:53 AM
The drawbuffer is context state, or at least it was before FBOs made it FBO state.

If you switch to a different context with MakeCurrent, and you query context state, you will get the state associated with the newly bound context which may differ from the old context. If you again bind the former context and query the drawbuffer, you will see that it remains unchanged.