title: Using SwapBuffers() with multiple OpenGL canvases and vertical sync?
body: <p>I have a GUI written using wxPython that contains two <code>GLCanvas</code>es, a 'display' canvas and a 'preview' canvas onto which I am drawing some very simple geometry using PyOpenGL. The 'preview' and 'display' canvases display the contents of the same framebuffer:</p>
  
  <p><img src="https://i.stack.imgur.com/140q7.png" alt="enter image description here"></p>
  
  <p>I need both of these canvases to be updated synchronously at a consistent framerate with no tearing.</p>
  
  <p>So far I have just been calling</p>
  
  <pre><code>self.SetCurrent()
  # draw stuff...
  self.SwapBuffers()
  </code></pre>
  
  <p>for both the preview and display canvases within my rendering loop. This works reasonably well provided that I disable vsync in my driver settings.</p>
  
  <p>However, if I enable vsync my framerate drops to ~30Hz, half the vertical refresh rate of my display. Presumably this is because the execution of the rendering loop stalls at each <code>SwapBuffers()</code> call waiting for the next vertical refresh - if I comment out one of the two <code>SwapBuffers()</code> calls, my framerate goes back up to 60Hz, but then of course only one of my canvases gets updated.</p>
  
  <p>What I'd really like is for both of my canvases to be updated synchronously, once per vsync interval. Is there any way that I can achieve this using the <code>wx.glcanvas.GLCanvas</code> class?</p>