+
+ /* jwz: the doc for glDrawBuffer says "The initial value is GL_FRONT
+ for single-buffered contexts, and GL_BACK for double-buffered
+ contexts." However, I find that this is not always the case,
+ at least with Mesa 3.4.2 -- sometimes the default seems to be
+ GL_FRONT even when glGet(GL_DOUBLEBUFFER) is true. So, let's
+ make sure.
+
+ Oh, hmm -- maybe this only happens when we are re-using the
+ xscreensaver window, and the previous GL hack happened to die with
+ the other buffer selected? I'm not sure. Anyway, this fixes it.
+ */
+ {
+ GLboolean d = False;
+ glGetBooleanv (GL_DOUBLEBUFFER, &d);
+ if (d)
+ glDrawBuffer (GL_BACK);
+ else
+ glDrawBuffer (GL_FRONT);
+ }
+
+