Ejemplo n.º 1
0
 def _with_context(self, hdc, proc, flush=False):
     old_hdc = wgl.wglGetCurrentDC()
     old_ctx = wgl.wglGetCurrentContext()
     result = wgl.wglMakeCurrent(hdc, self._win_context)
     try:
         self._with_share_group(proc)
         if flush:
             if self._win_dblbuf:
                 wgl.SwapBuffers(hdc)
             else:
                 gl.glFlush()
     finally:
         wgl.wglMakeCurrent(old_hdc, old_ctx)
Ejemplo n.º 2
0
 def _with_context(self, hdc, proc, flush=False):
     old_hdc = wgl.wglGetCurrentDC()
     old_ctx = wgl.wglGetCurrentContext()
     result = wgl.wglMakeCurrent(hdc, self._win_context)
     try:
         self._with_share_group(proc)
         if flush:
             if self._win_dblbuf:
                 wgl.SwapBuffers(hdc)
             else:
                 gl.glFlush()
     finally:
         wgl.wglMakeCurrent(old_hdc, old_ctx)