code: def swap_buffers(self):
          
          if not self.window.context:
              return
  
          self.frames += 1
          self.window.flip()
          self.window.dispatch_events()
docs: Swap buffers, increment frame counter and pull events