title: OpenGL - Scaling output canvas
body: <p>I'm pretty new to OpenGL, and I was doing some simple tests by using an integer array to draw pixels to the canvas, for example:</p>
  
  <pre><code>uint32_t* pixels = new uint32_t[200 * 200] //A 200*200 canvas is assumed
  //Get pixels somehow
  while(true)
  {
      glClear(GL_COLOR_BUFFER_BIT);
      glDrawPixels(pixels, GL_RGB, GL_UNSIGNED_INT, pixels);
      glSwapBuffers() //I'm using GLFW, but that's not important
  }
  </code></pre>
  
  <p>So far, so good. However, I wanted to try to stretch those pixels out to cover a wider canvas. If I had a 400*400 canvas, for example, I assume that glDrawPixels will only cover 1/4 of the entire drawing area, leaving the rest blank. How can I scale those pixels to fit the whole drawing area, using a nearest-integer method? (I don't care about other filters, just something that will give me a "pixelly" look.)</p>