code: def on_resize(self, width, height):
          
          self.width, self.height = width, height
          self.buffer_width, self.buffer_height = width, height
          self.resize(width, height)
docs: Pyglet specific callback for window resize events.