title: Pyglet: How to change resolution when you go fullscreen?
body: <p>I'm using Pyglet and I have a little that includes an object moving over a background. Both of them are represented by images (png and jpg).</p>
  
  <p>I've created a non-fullscreen window with size 800x600 and it works fine, but when I toggle to fullscreen... background and object have the same size as before and the rest of the screen is filled with black (empty color).</p>
  
  <p>What I want to do is to "scale" the images or change the resolution when I toggle fullscreen mode.</p>
  
  <p>I've read the documentation, but I can't find the answer to this.</p>
  
  <p>I know that with Pygame, this problem solves itself automatically (if you change the window size, everything rescales automatically)... but how do you do this with pyglet?</p>
  
  <p>This is my relevant code:</p>
  
  <pre><code>import pyglet
  
  WIDTH = 800
  HEIGHT = 600
  working_dir = '/where/i/have/my/images/'
  
  window = pyglet.window.Window(WIDTH, HEIGHT)
  
  background = pyglet.image.load(working_dir + 'background.jpg')
  flying_thing = pyglet.image.load(working_dir + 'flying_thing.png')
  
  @window.event
  def on_draw():
      window.clear()
      background.blit(0, 0)
      flying_thing.blit(WIDTH // 2, HEIGHT // 2)
  
  @window.event
  def on_key_press(symbol, modifiers):
      if symbol == pyglet.window.key.SPACE:
          window.set_fullscreen(not window.fullscreen)
  
  pyglet.app.run()
  </code></pre>
  
  <p>You can try this code changing working_dir, background.jpg and flying_thing.png to a working directory of yours and two images in it.</p>