title: Resizing a GLKView
body: <p>When a <code>GLKView</code> is resized, there are some behind-the-scenes operations that take place on the buffers and context of that <code>GLKView</code>. During the time it takes to perform these behind-the-scenes operations, drawing to the <code>GLKView</code> does not produce correct results.</p>
  
  <p>In my scenario, I have a <code>GLKView</code> that has <code>setNeedsDisplay</code> enabled, so that anytime I need to update it's contents on screen, I just call <code>-setNeedsDisplay</code> on that 
  <code>GLKView</code>. I'm using <code>GLKView</code> to draw images, so if I need to draw an image with a different size, I need to also change the size of the <code>GLKView</code>.</p>
  
  <p>The problem: When I change the size of the <code>GLKView</code> and call <code>setNeedsDisplay</code> on that view, the result on screen is not correct. This is because the <code>GLKView</code> is not done finishing the behind-the-scenes operations invoked by the new size change before it tries to draw the new image.</p>
  
  <p>I found a work-around to this by calling: <code>performSelector:@selector(setNeedsDisplay) withObject:nil afterDelay:0</code> instead of just <code>setNeedsDisplay</code> on the <code>GLKView</code>. This basically forces the main thread to wait for all the behind-the-scenes openGL operations to be completed before calling <code>setNeedsDisplay</code>. Although this works ok, I am wondering if there is a better solution. For example, is there an openGL call to make the thread wait for all openGL operations to be completed before continuing?</p>