(self)
Context manager that makes this Renderer's OpenGL context current.

    Yields:
      An object that exposes a `call` method that can be used to call a
      function on the dedicated rendering thread.

    Raises:
      RuntimeError: If this context is already current on another thread.
Context manager that makes this Renderer's OpenGL context current.
Context manager that makes this Renderer s OpenGL context current .
def make_current(self):
    """Context manager that makes this Renderer's OpenGL context current.

    Yields:
      An object that exposes a `call` method that can be used to call a
      function on the dedicated rendering thread.

    Raises:
      RuntimeError: If this context is already current on another thread.
    """

    with self._render_executor.execution_context() as ctx:
      if _CURRENT_CONTEXT_FOR_THREAD[self._render_executor.thread] != id(self):
        if _CURRENT_THREAD_FOR_CONTEXT[id(self)]:
          raise RuntimeError(
              'Cannot make context {!r} current on thread {!r}: '
              'this context is already current on another thread {!r}.'
              .format(self, self._render_executor.thread,
                      _CURRENT_THREAD_FOR_CONTEXT[id(self)]))
        else:
          current_context = (
              _CURRENT_CONTEXT_FOR_THREAD[self._render_executor.thread])
          if current_context:
            del _CURRENT_THREAD_FOR_CONTEXT[current_context]
          _CURRENT_THREAD_FOR_CONTEXT[id(self)] = self._render_executor.thread
          _CURRENT_CONTEXT_FOR_THREAD[self._render_executor.thread] = id(self)
          ctx.call(self._platform_make_current)
      yield ctx
def make_current ( self ) : with self . _render_executor . execution_context ( ) as ctx : if _CURRENT_CONTEXT_FOR_THREAD [ self . _render_executor . thread ] != id ( self ) : if _CURRENT_THREAD_FOR_CONTEXT [ id ( self ) ] : raise RuntimeError ( 'Cannot make context {!r} current on thread {!r}: ' 'this context is already current on another thread {!r}.' . format ( self , self . _render_executor . thread , _CURRENT_THREAD_FOR_CONTEXT [ id ( self ) ] ) ) else : current_context = ( _CURRENT_CONTEXT_FOR_THREAD [ self . _render_executor . thread ] ) if current_context : del _CURRENT_THREAD_FOR_CONTEXT [ current_context ] _CURRENT_THREAD_FOR_CONTEXT [ id ( self ) ] = self . _render_executor . thread _CURRENT_CONTEXT_FOR_THREAD [ self . _render_executor . thread ] = id ( self ) ctx . call ( self . _platform_make_current ) yield ctx