title: Trouble understanding render targets and back buffers in monogame
body: <p>My graphics device is set up as follows:</p>
  
  <pre><code>GraphicsDeviceManager = new GraphicsDeviceManager(GameBase.GameRef);
  GraphicsDeviceManager.PreferredBackBufferWidth = 640;
  GraphicsDeviceManager.PreferredBackBufferHeight = 480;
  GraphicsDeviceManager.ApplyChanges();
  </code></pre>
  
  <p>I can't find anywhere on google explaining exactly what the preferred back buffer width means.</p>
  
  <p>I set up a render target like this:</p>
  
  <pre><code>RenderTarget = new RenderTarget2D(
      GraphicsDeviceManager.GraphicsDevice,
      640,
      480,
      false,
      GraphicsDeviceManager.GraphicsDevice.PresentationParameters.BackBufferFormat,
      DepthFormat.Depth24);
  </code></pre>
  
  <p>I can't find anything on google about what the 640 and 480 actually mean with respect to how the render target is drawn.</p>
  
  <p>The problem I have is that if I resize the window, everything stretches. I'm trying to understand what monogame is doing to cause this, and then finally figure out a solution.</p>
  
  <p>At the start my window is 640x480 and the PreferredBackBufferWidth and height are 640/480 and the render target is 640/480</p>
  
  <p>If I resize the window to 1920x1080 for example, everything stretches, so somehow monogame no longer rendering the 640x480 texture onto a 640x480 part of the screen, but I haven't changed any of the values or done any code for this.</p>
  
  <p>If I resize the screen, should the render target be destroyed and recreated at the new size of the window, or should the back buffer width and height be changed, or both, or something else?</p>
  
  <p>I am very confused and there isn't any documentation online technical enough to answer in detail. Once I understand it I should be able to write some code so that when you resize the screen nothing happens, everything stay the same size, and there is a black area around the right/bottom edge because the window is larger than what i'm rendering to.</p>