code: def run_example(example_cls: Example, args=None):
      
      values = parse_args(args)
      window_cls = get_window_cls(values.window)
  
      window = window_cls(
          title=example_cls.title,
          size=example_cls.window_size,
          fullscreen=values.fullscreen,
          resizable=example_cls.resizable,
          gl_version=example_cls.gl_version,
          aspect_ratio=example_cls.aspect_ratio,
          vsync=values.vsync,
          samples=values.samples,
          cursor=values.cursor,
      )
  
      window.example = example_cls(ctx=window.ctx, wnd=window)
  
      start_time = time.time()
      current_time = start_time
      prev_time = start_time
      frame_time = 0
  
      while not window.is_closing:
          current_time, prev_time = time.time(), current_time
          frame_time = max(current_time - prev_time, 1 / 1000)
  
          window.render(current_time - start_time, frame_time)
          window.swap_buffers()
  
      duration = time.time() - start_time
      window.destroy()
      print("Duration: {0:.2f}s @ {1:.2f} FPS".format(duration, window.frames / duration))
docs: Run an example entering a blocking main loop
  
      Args:
          example_cls: The exmaple class to render
          args: Override sys.args