title: Swap Buffers and Clear Back using windowing system (GLX)
body: <p>When swapping between back and front buffers the content in the back buffer becomes undefined. I´d like to define it using the "windowing system", such as GLX, EGL, WGL. Using "native" renderer such as OpenGL (glClear) is my backup plan, don´t bother mentioning it. The reason it is backup is because I don´t want to mess with native rendering contexts. I´ll stick to X/GLX for this question but if you feel inclined to describe how to do it in other Environments then go ahead.</p>
  
  <p>From the Xlib documentation (<a href="http://www.x.org/docs/X11/xlib.pdf" rel="nofollow">http://www.x.org/docs/X11/xlib.pdf</a>) I find an operation, XClearWindow, for clearing window with "background pixel" (awesome name by the way... not).</p>
  
  <ol>
  <li>Does XClearWindow clear front/back or both buffers? I guess back buffer makes sense but I can´t figure it out from Xlib documents alone... And if anyone asked about triple buffers, it wasn´t me!</li>
  <li>Is it synchronous to OpenGL rendering, or do I have to synchronize myself by for example calling glxWaitGL before the operation?</li>
  <li>Is the command blocking, ie halts until complete? Implementation dependent?</li>
  </ol>
  
  <p>Other suggestions as how to clear the back buffer after a swap using windowing system (GLX) is appriciated.</p>
  
  <p>Cheers!</p>