Esempio n. 1
0
 def _with_context(self, proc, flush):
     #print "GLContext._with_context: Entering context", self._ns_context ###
     old_context = NSOpenGLContext.currentContext()
     self._ns_context.makeCurrentContext()
     try:
         self._with_share_group(proc)
         if flush:
             self._ns_flush()
     finally:
         #print "GL: Restoring previous context" ###
         if old_context:
             old_context.makeCurrentContext()
         else:
             NSOpenGLContext.clearCurrentContext()
Esempio n. 2
0
 def _with_context(self, proc, flush):
     # print "GLContext._with_context: Entering context", self._ns_context ###
     old_context = NSOpenGLContext.currentContext()
     self._ns_context.makeCurrentContext()
     try:
         self._with_share_group(proc)
         if flush:
             self._ns_flush()
     finally:
         # print "GL: Restoring previous context" ###
         if old_context:
             old_context.makeCurrentContext()
         else:
             NSOpenGLContext.clearCurrentContext()