title: OpenGL prevent stretching on window resize
body: <p>I have a ortho set up at the moment for 2D, when I resize the window it stretches anything that is drawn in the window, is there a way to either just have black bars show when the window is resized or at least maintain the aspect ratio of the contents, so they dont stretch at all. I have tried a few implementations that I have seen on here, but nothing really works.</p>
  
  <p>EDIT: Sorry guys had a bit of a blonde moment</p>
  
  <pre><code>    Protected Overrides Sub OnResize(ByVal e As EventArgs)
          MyBase.OnResize(e)
  
          GL.Viewport(0, 0, Width, Height)
  
          GL.MatrixMode(MatrixMode.Projection)
          GL.LoadIdentity()
          GL.Ortho(-1.0, testvalue, testvalue , 1.0, 0.0, 4.0)
      End Sub 
  </code></pre>
  
  <p>testvalue at the moment is 5000, window size is 800x800</p>