(func)
return wrapped_func
Decorator which checks that GLFW is being used for offscreen rendering.
Decorator which checks that GLFW is being used for offscreen rendering.
Decorator which checks that GLFW is being used for offscreen rendering .
def _check_valid_backend(func):
  """Decorator which checks that GLFW is being used for offscreen rendering."""
  @functools.wraps(func)
  def wrapped_func(*args, **kwargs):
    if _render.BACKEND != 'glfw':
      raise RuntimeError(
          '{func} may only be called if using GLFW for offscreen rendering, '
          'got `render.BACKEND={backend!r}`.'.format(
              func=func, backend=_render.BACKEND))
    return func(*args, **kwargs)
  return wrapped_func
def _check_valid_backend ( func ) : @ functools . wraps ( func ) def wrapped_func ( * args , * * kwargs ) : if _render . BACKEND != 'glfw' : raise RuntimeError ( '{func} may only be called if using GLFW for offscreen rendering, ' 'got `render.BACKEND={backend!r}`.' . format ( func = func , backend = _render . BACKEND ) ) return func ( * args , * * kwargs ) return wrapped_func